queue container?
Martin Nowak
dawg at dawgfoto.de
Thu Oct 27 11:06:01 PDT 2011
On Wed, 26 Oct 2011 22:48:01 +0200, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> 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
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
More information about the Digitalmars-d
mailing list