[concurrency-interest] PriorityLinkedQueue ?

Hanson Char hanson.char at gmail.com
Tue Sep 12 00:46:31 EDT 2006


Oops, forget about the "delay" priority.  Better to directly use
j.u.c.PriorityBlockingQueue and implement Comparable for each q item.  There
is still no "decrease Key" operation  in PriorityBlockingQueue though ...

H

On 9/11/06, Hanson Char <hanson.char at gmail.com> wrote:
>
> >This might be useful for creating work load with priority associated with
> it and submitting
> > to the threadpool executor.
>
> If you can determine the priority of each work item a priori, you can
> assign it an expired "delay" and place it on a j.u.c.DelayQueue.  The
> higher the prioirty, the further into the past a work item should be
> "expired".
>
> The consumer(s) can then dequeue/process items with a priority according
> to their expiration.
>
> However, if the prioirty of each work item needs to be changed after it
> has been placed on the queue, then this won't work as DelayQueue would
> ignore such changes.
>
> It would be really nice if there is a "decrease Key" operation as Tim
> Peierls pointed out earlier under the email thread " Changing delays in
> DelayQueue ?"
>
> Hanson
>
> On 9/11/06, Hanson Char <hanson.char at gmail.com> wrote:
> >
> > Is j.u.PriorityQueue what you are looking for ?
> >
> > Hanson
> >
> >
> > On 9/11/06, rbalamohan <rbalamohan at sonoasystems.com > wrote:
> > >
> > >  The results look really promising.
> > >
> > > On a similar note, I was wondering why we don't have "PRIORITY BASED
> > > LINKED QUEUE"
> > >
> > > This might be useful for creating work load with priority associated
> > > with it and submitting to the threadpool executor.
> > >
> > > ~Rajesh.B
> > >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060911/8fcc838c/attachment.html 


More information about the Concurrency-interest mailing list