[529] in Pthreads mailing list archive
Re: wait on a file descriptor and a condition variable
daemon@ATHENA.MIT.EDU (Bill Gribble)
Tue Nov 26 12:08:14 1996
Date: Tue, 26 Nov 1996 08:41:52 -0600
From: Bill Gribble <grib@cs.utexas.edu>
To: seiki@akashi.flab.fujitsu.co.jp
Cc: pthreads@MIT.EDU
In-Reply-To: <9611261400.AA10630@meridian.akashi.flab.fujitsu.co.jp>
(seiki@flab.fujitsu.co.jp)
> I need a method to wait on a file descriptor and a condition variable
> simultaneously. The condition_signal() and the condition_broadcast()
> call can not wake up the blocking select() call.
One way: create a new condition variable and two new threads. one thread
does the select, one thread waits on the original condition variable, and
both of them signal the new condition variable when their task is
finished. The original thread sleeps on the new condition variable so
it wakes up when either thing has happened.
Bill Gribble