Article View: comp.os.mach
Article #1295Re: timeout on condition_wait()
From: Richard.Draves
Date: Thu, 22 Feb 1990 07:28
Date: Thu, 22 Feb 1990 07:28
18 lines
1320 bytes
1320 bytes
Excerpts from netnews.comp.os.mach: 16-Feb-90 timeout on condition_wait() Eric Hammond@kgw2.bwi.WE (2340) > ===> I want to do a condition_wait() with a timeout. <=== I would solve this problem by developing a new abstract data type, timer_condition_t. Export operations like timer_condition_signal, timer_condition_broadcast, timer_condition_wait (which takes a timeout). The question then is how to implement the ADT. One possibility is to have a service thread that is responsible for waking up timed-out sleepers. The service thread would have a queue of wait events. Each wait event would also be on a list tied to the timer_condition_t. The wait event would contain a normal condition_t that is used to do the actual sleeps/wakeups; each sleeping cthread would have its own wait event. And of course you'd need appropriate locking. Rich
Technical Details
Message-ID:
<sZstG8u00hYPAk2O5m@cs.cmu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!<UNAUTHENTICATED>+References:
<375@kgw2.bwi.WEC.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!<UNAUTHENTICATED>+ From: Richard.Draves@CS.CMU.EDU Newsgroups: comp.os.mach Subject: Re: timeout on condition_wait() Message-ID: <sZstG8u00hYPAk2O5m@cs.cmu.edu> Date: 22 Feb 90 07:28:08 GMT References: <375@kgw2.bwi.WEC.COM> Distribution: usa Organization: Carnegie Mellon, Pittsburgh, PA Lines: 18 In-Reply-To: <375@kgw2.bwi.WEC.COM>