[concurrency-interest] Quick question on ConcurrentLinkedQueue

Hanson Char hanson.char at gmail.com
Mon Apr 9 01:19:41 EDT 2007

Say we have two initially empty j.u.c.ConcurrentLinkedQueue, clq1 and
clq2.  If two threads offered to each queue individually at the same
time, followed by polling the other queue, is it possible for both
threads to observer the other queue as being empty ?

In other words:

Time   Thread1      Thread2
0         clq1.offer     clq2.offer
1         x=clq2.poll   y=clq1.poll

Can both x and y be null ?

Hanson Char

More information about the Concurrency-interest mailing list