Prioritised ThreadPoolExecutor

Hi, I need a prioritised version of the ScheduledThreadPoolExecutor but there doesn't seem to be one in the standard API. Does anyone know of one, or can anyone give me some pointers on extending Java's one to provide priorotisation. I notice that on TheadPoolExecutor I can explicity set the type of BlockingQueue but this option is not available on ScheduledBlockingQueue

Thanks

Rob

Message was edited by:

bubblenut2

Message was edited by:

bubblenut2

[499 byte] By [bubblenut2a] at [2007-11-27 9:13:28]
# 1
PriorityBlockingQueue
hiwaa at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...
# 2
That wasn't very helpfull, but thank you for trying.
bubblenut2a at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...
# 3
> That wasn't very helpfullWhy? Will you explain for the sake of us rest of the forum friends?
hiwaa at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...
# 4

Sorry, a PriorityBlockingQueue can't be used with a ScheduledThreadPoolExecutor as it doesn't give you an option to provide your own BlockingQueue. Also, as I have since found out, a PriorityBlockingQueue can't be used with a regular ThreadPoolExecutor as it wraps your Runnable in a FutureTask object - which you also cannot provide - which is not Comparable.

bubblenut2a at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...
# 5
It would be great if u can tell us what type of solution are u trying to design with threads.
Nistelrooya at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...
# 6
> it doesn't give you an option to provide your own BlockingQueueIt does!
hiwaa at 2007-7-12 22:00:53 > top of Java-index,Java Essentials,Java Programming...