[531] in Pthreads mailing list archive

home help back first fref pref prev next nref lref last post

Re: wait on a file descriptor and a condition variable

daemon@ATHENA.MIT.EDU (Bill Gribble)
Tue Nov 26 14:16:18 1996

To: daf@sdoatl.mmr.lucent.com
Date: Tue, 26 Nov 1996 08:41:52 -0600
From: Bill Gribble <grib@cs.utexas.edu>
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


home help back first fref pref prev next nref lref last post