Just curious, could a Facet be used to implement lock/no lock relatively easily.<div><br></div><div>(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?)<br>
<br><div class="gmail_quote">On Thu, Oct 27, 2011 at 11:06 AM, Martin Nowak <span dir="ltr"><<a href="mailto:dawg@dawgfoto.de">dawg@dawgfoto.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, 26 Oct 2011 22:48:01 +0200, Steven Schveighoffer <<a href="mailto:schveiguy@yahoo.com" target="_blank">schveiguy@yahoo.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Wed, 26 Oct 2011 14:44:50 -0400, Gor Gyolchanyan <<a href="mailto:gor.f.gyolchanyan@gmail.com" target="_blank">gor.f.gyolchanyan@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Not necessarily. You don't even need to have the entire function<br>
synchronized. You can define your own synchronization blocks, using<br>
the object's or classes monitor.<br>
</blockquote>
<br>
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.<br>

<br>
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.<br>
<br>
-Steve<br>
</blockquote>
<br></div></div>
There are tons of lock-free containers.<br>
Especially queues and deques have well know implementations.<br>
But you can go as far as maps and doubly linked lists.<br><font color="#888888">
<br>
martin<br>
</font></blockquote></div><br><br clear="all"><div><br></div>-- <br>John<br>blog: <a href="http://arrizza.blogspot.com/">http://arrizza.blogspot.com/</a><br>web: <a href="http://www.arrizza.com/">http://www.arrizza.com/</a><br>

</div>