A monitor for every object

Tomek Sowiński just at ask.me
Fri Feb 4 15:26:43 PST 2011


Tomek Sowiński napisał:

> > D's monitors are lazily created, so there should be no issue with resource  
> > allocation.  If you don't ever lock an object instance, it's not going to  
> > consume any resources.  Most of the time the extra word isn't noticed  
> > because the memory size of a class is usually not exactly a power of 2.  
> 
> Except when you put'em in an array. Could happen.

Sorry, for some reason I thought the mutex is on the stack.

-- 
Tomek



More information about the Digitalmars-d mailing list