Re: lock-free stack with hazard list performance

"Nicholas \"Indy\" Ray" <[email protected]>
Newsgroups gmane.games.devel.algorithms
Message-ID <[email protected]>
On Tue, Apr 21, 2009 at 4:28 PM, Stephan Rose <[email protected]> wrote:
> 2. Remove Node A and delete it. Major crash right there when thread 1
> now tries do it's CAS.

Here is where I am confused, shouldn't the CAS be on the head pointer
during a dequeue so, that if the CAS is successful (assuming that
dequeue is the only way to get a reference to an item on the list,
which is how lock-free queues should be anyways) you know that you are
the only thread that has access to the node?

> Both problems can be solved by ensuring that Node A is not recycled nor
> deleted until all threads release their reference to it. All lock-free
> implementations so far I've found have been in managed languages such as
> C# or Java for that reason so far as the GC ensures exactly that.

Again, not sure why multiple threads have reference to nodes still on the queue.

Nicholas "Indy" Ray

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
GDAlgorithms-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gdalgorithms-list
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_name=gdalgorithms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.