Thread overview
condition variable/semaphore/etc
Feb 09, 2007
Howard Berkey
Feb 09, 2007
Sean Kelly
Feb 09, 2007
Howard Berkey
February 09, 2007
Since D has the synchronized keyword in the language, implementing simple mutexes and/or critical sections are straightforward and trivial.  However, I have not found thus far any language (or phobos class) implementing something like a condition variable.

Am I just missing it?  It's certainly possible, as I am just now being able to dive down into D.

CondVars (or, more easily, counting semaphores, which are useful in some situations that condvars are) are of course implementable by anyone based on a Mutex primitive, but it seems like they would be a good addition to the library.

February 09, 2007
Howard Berkey wrote:
> Since D has the synchronized keyword in the language, implementing simple mutexes
> and/or critical sections are straightforward and trivial.  However, I have not found
> thus far any language (or phobos class) implementing something like a
> condition  variable.

There isn't one in Phobos.  Tango has a locks package in the works which contains semaphores, condvars, read/write locks, and a few other things though, IIRC.  If all goes as planned it should be in the next release.


Sean
February 09, 2007
That is what I had thought.  Thanks.

Sean Kelly Wrote:

> Howard Berkey wrote:
> > Since D has the synchronized keyword in the language, implementing simple mutexes and/or critical sections are straightforward and trivial.  However, I have not found
>  > thus far any language (or phobos class) implementing something like a
> > condition  variable.
> 
> There isn't one in Phobos.  Tango has a locks package in the works which contains semaphores, condvars, read/write locks, and a few other things though, IIRC.  If all goes as planned it should be in the next release.
> 
> 
> Sean