Just curious, could a Facet be used to implement lock/no lock relatively easily.
(BTW, as great as this thread has gone, I was wondering if someone could answer my original question about using existing Array container for a queue?) On Thu, Oct 27, 2011 at 11:06 AM, Martin Nowak <d...@dawgfoto.de> wrote: > On Wed, 26 Oct 2011 22:48:01 +0200, Steven Schveighoffer < > schvei...@yahoo.com> wrote: > > On Wed, 26 Oct 2011 14:44:50 -0400, Gor Gyolchanyan < >> gor.f.gyolchan...@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 >> > > There are tons of lock-free containers. > Especially queues and deques have well know implementations. > But you can go as far as maps and doubly linked lists. > > martin > -- John blog: http://arrizza.blogspot.com/ web: http://www.arrizza.com/