GC, the simple solution

Lionello Lunesu lio at lunesu.remove.com
Thu Jun 15 04:22:29 PDT 2006


Sean Kelly wrote:
> Lionello Lunesu wrote:
>> Interesting indeed!
>>
>> I'm currently reading Boehm's article "Threads Cannot be Implemented 
>> as a Library". I wonder if this means that threads should become 
>> primitives of some sort [in D] ?
> 
> It's been a while since I read that article, but I think D already has 
> enough in-language recognition of threading issues to escape most/all of 
> the problems Boehm mentions: Thread is a standard library component 
> rather than a third-party component, synchronized is available for 
> mutual exclusion, and volatile (plus perhaps inline asm code) is enough 
> to manage lock-free work.  A more robust multithread-aware memory model 
> would be good to have, but it's a sticky enough issue that I think 
> Walter is right for waiting on that for now.

...that leaves only atomic operations? Or would "volatile" or 
"synchronized" take care of memory fencing and such?

Would be nice if there were an built-in type with overloaded ++x, x++, 
x=y, all atomic. (I've seen some C++ templates that do this.)

L.



More information about the Digitalmars-d mailing list