Article about problems & suggestions for D 2.0

Sean Kelly sean at invisibleduck.org
Wed Aug 31 06:54:40 PDT 2011


The unshared methods are only ever meant to be called by the queue owner. They access some member data without synchronization to make the queue efficient for receive calls. I could make these methods shared anyway, but if they were called concurrently by accident it would mean data corruption. 

Sent from my iPhone

On Aug 31, 2011, at 12:37 AM, Kagamin <spam at here.lot> wrote:

> Sean Kelly Wrote:
> 
>> The shared portion, rather than labeling functions as synchronized, uses synchronized internally to make the mutex use as fine-grained as possible.  And the logically unshared portion only synchronizes when accessing the shared data in the object.
> 
> What's the difference? Both access shared data and synchronize. If the data accessed is unshared, there should be no problem to do it from shared method - there will be no barriers because the data is unshared, as I understand it.


More information about the Digitalmars-d mailing list