[concurrency-interest] Is there a ConcurrentBlockingQueue ??

Gregg Wonderly gregg at cytetech.com
Tue Mar 20 18:52:52 EDT 2007



Hanson Char wrote:
> Hi Gregg,
> 
>> It seems like parkq should always be emptied
> 
> 
> I think I see what you mean.  Yes there is a chance that some unparked
> items are left over in parkq, if an item is placed to q after a
> ThreadMarker is placed to parkq but before the thread (of the
> associated ThreadMarker) is parked.  In such case, the left-over
> ThreadMarker's would have "parked" set to false.
> 
> The logic in the offer method attempts to minimize the left-over in
> parkq by removing all consecutive ThreadMarker with "parked" set to
> false.

duh...  I missed that looping logic associated with "parked".  I was thinking it 
returned no matter what.  It looks to me like that should take care of the left 
behind "unparked" marker entries.

Sorry for the hassle.

Gregg Wonderly


More information about the Concurrency-interest mailing list