On Wed, May 02, 2001 at 03:05:45PM -0400, Rajah, PushpamX wrote:
> I would like to create timers for threads which is similar to NT timers like
> eg CreateWaitableTimer() & SetWaitableTimer().
> 
> Is there anyway to do that in linux.

I don't know anything about threading on Windows, but in Linux's pthreads
implementation there is pthread_cond_timedwait() in which you specify a
condition variable and an absolute time (a point in future time, NOT the
length of time to wait). If the condition occurs before the time comes,
the thread is awakened. If the time occurs first, the thread is
awakened. There are, of course, gotchas lurking, so become well informed
before trying to use these routines.

I suggest you buy a good book on posix threads. I can recommend the
one by Dave Butenhof as a good one. Also, I suggest you read the
newsgroup comp.programming.threads and post questions there. A number
of knowledgeable people hang out there, including but not limited to
Dave Butenhof.

Fred
-- 
---- Fred Smith -- [EMAIL PROTECTED] ----------------------------
   "For the word of God is living and active. Sharper than any double-edged 
   sword, it penetrates even to dividing soul and spirit, joints and marrow; 
              it judges the thoughts and attitudes of the heart."  
---------------------------- Hebrews 4:12 (niv) ------------------------------



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to