Message passing between threads: Java 4 times faster than D

Martin Nowak dawg at
Fri Feb 10 11:12:50 PST 2012

On Fri, 10 Feb 2012 15:07:41 +0100, deadalnix <deadalnix at> wrote:

> Le 09/02/2012 20:57, Martin Nowak a écrit :
>> On Thu, 09 Feb 2012 16:44:46 +0100, Sean Kelly <sean at>
>> wrote:
>>> So a queue per message type? How would ordering be preserved? Also,
>>> how would this work for interprocess messaging? An array-based queue
>>> is an option however (though it would mean memmoves on receive), as
>>> are free-lists for nodes, etc. I guess the easiest thing there would
>>> be a lock-free shared slist for the node free-list, though I couldn't
>>> weigh the chance of cache misses from using old memory blocks vs. just
>>> expecting the allocator to be fast.
>> I didn't yet got around to polish my lock-free SList/DList  
>> implementations,
>> but mutexes should only become a problem with high contention when you
>> need to block.
>> You'd also would need some kind of blocking for lock-free lists.
> Doesn't this require shared to be working ?

Shared is already very helpful for writing lock-free stuff.
I still need to use atomic load/store to make them portable though.
If shared would add memory fences for full sequential order one would
rather hack around this using weaker ordering.

More information about the Digitalmars-d mailing list