[concurrency-interest] PriorityBlockingQueue question

Tim Peierls tim at peierls.net
Tue Sep 26 10:35:32 EDT 2006


On 9/25/06, David Walend <david at walend.net> wrote:
>
> I've got something coded up that should work, but isn't very
> satisfying. I did find a way to signal just the conditions that
> matter, but take() and poll(timeout) still have to scan back to find
> the right message.
>
> I know there's still things to clean up, but I'm still trying to
> convince myself this is a good approach.


I'm trying to understand the code first. How can take() ever work with this
code:

while(message == null)
{
    condition.await();
}

message is a local variable, so how can you wait for it to become non-null?


I'd like a way to clean up the scanForMatchingMessages() st/ it isn't
> scanning. Any ideas?


No ideas for this -- I'm thinking about the other approach.

--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060926/51f85122/attachment.html 


More information about the Concurrency-interest mailing list