![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Threads and Threads Count ? | varungupta | UNIX for Advanced & Expert Users | 2 | 03-21-2008 06:23 PM |
| Multi-threading-- calling same function through different threads | arunchaudhary19 | High Level Programming | 1 | 12-10-2007 08:54 AM |
| Multi User Multi Task | Reza Nazarian | UNIX for Dummies Questions & Answers | 6 | 04-13-2006 06:23 AM |
| Multi-threading questions | DreamWarrior | High Level Programming | 1 | 11-02-2003 08:34 PM |
| multi-file multi-edit | kielitaide | UNIX for Dummies Questions & Answers | 12 | 06-28-2001 12:12 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Hi
I have questions about timer function in multi-threads environment. My application has multi-threads, in one thread, I set a timer, when the timer expires, the timer function will interrupt other thread and execute. I am not clear which thread will be interrupted by the timer function ? Does the thread in which I set the timer be interrupted, or it depends on OS. If my application is running on one CPU machine, I think the current thread will be interrupted. If the application is running on mult-CPU machine, and SMP is on, which thread will be interrupted. If the thread I set the timer has finished and gone, when timer expires, what will happen ? thanks & regards Jeffrey 06-07-04 |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Open source is life savor
See the page
WebSVN - packet-o-matic - Rev 157 - -trunk-src-timers.c https://svn.tuxicoman.be/filedetails...Ftimers.c&sc=1 Both timer.c and timer.h is complete implementation |
|
#3
|
|||
|
|||
|
Quote:
(a) what mechanism are you using for timers? (b) what do you mean by interrupt? I do hope you are using "pthread_cond_timedwait". From what you say I would suggest you don't need a separate timer thread, you have "other thread" wait on "pthread_cond_timedwait". |
|||
| Google The UNIX and Linux Forums |