Shachar, thank you very much for the valuable link. At first glance, it
indeed seems this is what I'm looking for and I'll investigate it deeper
today.
Thanks to all others who tried to help. I've learned a lot from this thread
and it seems I have got the correct route to implement 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
>
>
> 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 multithread
> > application, since it seems that each call to alarm() affects or even
> > cancels the previous one, even though the previous call was in another
> > thread.
> > Do I miss here something? may this still be used in a multithread
> > application?
> > Yes, I know about getitimer and setitimer, but I do not understand how
> > to adjust the timer, for example if I want a timer of 20 seconds.
> > If this is the solution you suggest, please provide an example that
> > shows how to use those functions.
> > Generally, any advise concerning this issue will be most appreciated.
> > Thanks, Rafi.
> I've read the entire thread, and it has some very correct advice from
> Gilad and others.
>
> However, before you start implementing away, I suggest you take a look
> at libevent (http://freshmeat.net/projects/libevent/). I believe it does
> all you're looking for (and quite a bit more), and may save you a
> considerable amount of time.
>
> Shachar
>
> --
> Shachar Shemesh
> Lingnu Open Source Consulting ltd.
> Have you backed up today's work? http://www.lingnu.com/backup.html
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.432 / Virus Database: 268.16.7/620 - Release Date:
> 1/8/2007 4:12 PM
>
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/620 - Release Date: 1/8/2007
4:12 PM


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to