[concurrency-interest] ConcurrentLinkedQueue CAS-like poll/iterator remove

Benedict Elliott Smith belliottsmith at datastax.com
Tue Feb 4 11:48:23 EST 2014


This may be a bit on the late side for inclusion in JDK8, but I noticed
that ConcurrentLinkedQueue has moved to a non-blocking algorithm, which is
great. It means I may be able to dispose of my own in some places.

However, it would be particularly nice to get a pollIfHead(item) method,
which behaves like a depth-1 limited remove(item), and possibly an
extension of Iterator that supports atomicRemove() (returning
success/failure) or similar.

Both of these operations have been essential in some algorithms I've
implemented recently, although I may be fairly alone in that. However,
they're both very easy to add to the new CLQ implementation.

I'd be happy to submit a patch, although other than deciding the name of
any new interface for atomic interator removal, it's pretty trivial.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20140204/69591bb0/attachment.html>

More information about the Concurrency-interest mailing list