queue container?

J Arrizza cppgent0 at gmail.com
Thu Oct 27 19:52:33 PDT 2011


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 <dawg at dawgfoto.de> wrote:

> 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
>



-- 
John
blog: http://arrizza.blogspot.com/
web: http://www.arrizza.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20111027/e6e1a060/attachment-0001.html>


More information about the Digitalmars-d mailing list