The "no gc" crowd

Dicebot public at dicebot.lv
Fri Oct 11 10:50:23 PDT 2013


On Friday, 11 October 2013 at 17:46:01 UTC, Sean Kelly wrote:
> The thing with locks is that you need to use the same lock for 
> all accesses to a set of mutated data or atomicity isn't 
> guaranteed.  And if you're locking externally you don't know 
> what might change inside a class during a method call, so you 
> have to use the same lock for all operations on that object, 
> regardless of what you're doing.  At that point you may as well 
> just synchronize on the class itself and be done with it.  So 
> sure, it saves you from having to define shared or synchronized 
> methods, but I don't think this should be how we want to write 
> concurrent code in D.

How can one possibly used "synchronized" for this in absence of 
classes if desire behavior is to lock an entity, not statement 
block?


More information about the Digitalmars-d mailing list