What sync object should i use?

Heinz thor587 at gmail.com
Mon May 13 12:53:52 PDT 2013


On Monday, 13 May 2013 at 19:49:51 UTC, Steven Schveighoffer 
wrote:
> On Mon, 13 May 2013 15:41:47 -0400, Heinz <thor587 at gmail.com> 
> wrote:
>
>> Hi,
>>
>> I'm looking for an object in "core.sync" whose internal 
>> counter can be 0 or 1 (signaled/not signaled), just like Event 
>> Objects in Win32 
>> (http://msdn.microsoft.com/en-us/library/windows/desktop/ms682396%28v=vs.85%29.aspx). 
>> The object must be waitable and able to notify waiters. A 
>> semaphore is the most similar thing but its internal counter 
>> can range from 0 to x. I can perfectly create and use an event 
>> under Win32 for my needs but i do not know their counterparts 
>> in FreeVSD, Linux and OSX; that's why i'm trying to use an 
>> already implemented object from the runtime.
>>
>> This is what i'm trying to do:
>>
>> void MyFunc()
>> {
>>
>> }
>
> core.sync.condition and core.sync.mutex
>
> I'd point at the docs, but they are poor.
>
> Search online for docs on how mutexes and conditions work.  
> It's very similar to Windows events.
>
> -Steve

Thanks Steve for your quick reply. You answered me before i fixed 
my post.
I'll take a look at what you say and post again here in case i 
have other questions.


More information about the Digitalmars-d-learn mailing list