Wait-free thread communication

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 28 10:16:14 PDT 2016


On 28-Mar-2016 20:03, Jin wrote:
> On Monday, 28 March 2016 at 16:39:45 UTC, Dmitry Olshansky wrote:
>> On 27-Mar-2016 21:23, Jin wrote:
>>> I just use this queues to implement Go like api for concurrency
>>> (coroutines+channels):
>>> http://forum.dlang.org/thread/lcfnfnhjzonkdkeaumds@forum.dlang.org
>>>
>>>
>>
>> If nothing changed implementation-wise this is just data-racy queues :)
>
> Why?

All I see is a ring buffer with hand-wavy atomicFence on one of mutating 
operations. popFront is not protected at all.

Also force yielding a thread is not a sane synchronization technique.

Over all - I suggest to not label this as "wait free" code as it's waaay 
far from what it takes to get that.

-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list