RE: implement timers in a multi thread application

2007-01-08 Thread Rafi Cohen
nt this. Thanks, Rafi. > -Original Message- > From: Shachar Shemesh [mailto:[EMAIL PROTECTED] > Sent: Tuesday, January 09, 2007 9:00 AM > To: Rafi Cohen > Cc: [EMAIL PROTECTED] Org. Il > Subject: Re: implement timers in a multi thread application > > > Ra

RE: implement timers in a multi thread application

2007-01-08 Thread Rafi Cohen
Sent: Tuesday, January 09, 2007 1:23 AM To: Linux-IL Subject: Re: implement timers in a multi thread application On 09/01/07, Rafi Cohen <[EMAIL PROTECTED]> wrote: Gilad, thank you very much for your advise. I tend to implement it, but I still remain with the following questio

Re: implement timers in a multi thread application

2007-01-08 Thread Shachar Shemesh
Rafi Cohen wrote: > Hi, I need some advice implementing timers in a multithread aplication > on linux (suse 9.3, kernel 2.6.11). > The application is written in C. > At first, I chose to use alarm() with a handler for SIGALRM, but after > some tests I concluded tht it's not wise to use this in a mu

Re: implement timers in a multi thread application

2007-01-08 Thread Amos Shapira
On 09/01/07, Rafi Cohen <[EMAIL PROTECTED]> wrote: Gilad, thank you very much for your advise. I tend to implement it, but I still remain with the following question: if a thread has various timeout cases, for example, one after 10 seconds and another one after 40 seconds, how this could be impl

RE: implement timers in a multi thread application

2007-01-08 Thread Rafi Cohen
-Yossef > Sent: Monday, January 08, 2007 8:52 PM > To: Rafi Cohen > Cc: [EMAIL PROTECTED] Org. Il > Subject: Re: implement timers in a multi thread application > > > Rafi Cohen wrote: > > Hi, I need some advice implementing timers in a multithread aplication > &

Re: implement timers in a multi thread application

2007-01-08 Thread Gilad Ben-Yossef
Rafi Cohen wrote: Hi, I need some advice implementing timers in a multithread aplication on linux (suse 9.3, kernel 2.6.11). The application is written in C. At first, I chose to use alarm() with a handler for SIGALRM, but after some tests I concluded tht it's not wise to use this in a multithr

Re: implement timers in a multi thread application

2007-01-07 Thread Peter
There are only 3 timers available to any process. You already discovered that the alarm timer is one of them. Then you can implement timing using select() timeouts. If you have many timers in a process you need to implement your own multi-timer using these calls. Peter =