queue container?

Steven Schveighoffer schveiguy at yahoo.com
Wed Oct 26 13:48:01 PDT 2011


On Wed, 26 Oct 2011 14:44:50 -0400, Gor Gyolchanyan  
<gor.f.gyolchanyan at gmail.com> wrote:

> Not necessarily. You don't even need to have the entire function
> synchronized. You can define your own synchronization blocks, using
> the object's or classes monitor.

I would think to get much benefit over blind "synchronize every method"  
you'd want to have multiple locks to allow two non-conflicting  
operations.  It's not easy to design, nor does it make sense to me that  
the same API should be used.

I almost think that the concept of an efficiently shared container is  
completely different than a non-shared one.  I believe there are even  
designs for lock-free containers out there.

-Steve


More information about the Digitalmars-d mailing list