I'm gonna implement a scheduler using thread pool & priority queue in Java and I want to ask whether anybody knows any existing implementations or not, so I don't have spend time on it :-)...
Basically, the ScheduledThreadPoolExecutor in java.util.concurrent package provides almost functions I need except the "priority queue". As I roughly checked the built-in java libraries, I couldn't find any priority queue which supports modifying & updating "priority" value of an element externally after it has been put to the queue.
I need this kind of priority queue to be used in a downloader-liked project. I want to allow users to modify the priority of each download on-the-fly and its position in the queue is automatically updated. The PriorityQueue is not implemented in this way, in order to get correct priority, each time we change its priority value we have to remove & submit it again...
Did anybody work on this before?