Condition variables?

Steven Schveighoffer schveiguy at yahoo.com
Tue Oct 2 09:33:27 PDT 2007


"Sean Kelly" <sean at f4.ca> wrote in message 
news:fdtqpn$259o$1 at digitalmars.com...
> Steven Schveighoffer wrote:
>>
>> So the code above has to do something special by unlocking the object 
>> before waiting using an atomic operation.  I think this requires some 
>> language support.
>
> Doing this efficiently typically requires OS support.  The library must 
> indicate to the OS that a context switch may not occur while certain 
> portions of the code are executing.  It is possible to implement condvars 
> without OS support as well, but the implementation tends to be fairly 
> complicated.  Look for version(Win32) blocks in the Tango implementation 
> for one such example.

Why can't you use SignalObjectAndWait?  Are you not using Win32 Mutexes in 
Win32?

I implemented a C++ OS abstraction library, and I had no problems 
implementing conditions on Win32 using OS support...

-Steve 





More information about the Digitalmars-d mailing list