Condition variables?

David Wilson dw at botanicus.net
Sat Sep 29 22:48:07 PDT 2007


On 30/09/2007, Janice Caron <caron800 at googlemail.com> wrote:
> On 9/30/07, David Brown <dlang at davidb.org> wrote:
> > Hopefully I'm missing something obvious here, but D and phobos seem to
> > be missing any kind of condition variables.
>
> I'm not sure what this has to do with D. It's a platform thing, not a
> language thing. Linux has condition variables; Windows doesn't.
> Windows has Events, Linux doesn't. What you're talking about is the
> pthreads (posix threads) library. That's written in C, so you should
> be able to call all the functions in it no problem - but don't expect
> your program to run on Windows.
>
> Exactly the same problem exists in C or C++, which is why I said it's
> not a language thing.

Hi Janice,

Condition variables are a much more theoretical concept than simply
"implemented in POSIX", and FWIW were finally added to Vista:

   http://msdn.microsoft.com/msdnmag/issues/07/06/Concurrency/default.aspx

Quoth:

   The condition variable has existed in other threading libraries for some
   time and has been sorely missed from the Windows SDK.

There's a hundred and one different things in the text books
implemented in terms of them, Windows just took the approach of
providing abstractions instead.


David.

>



More information about the Digitalmars-d mailing list