|
I've got a bunch of tasks that need to get done (download some files and do some processing on them) and I'd like these to happen concurrently so I've been using a ThreadPoolExecutor and just shoving Runnables at it. Is there any sane way to have some tasks go to the front of the queue instead of the back (i.e. cutting in line?). There are two ways I've thought to do it: 1) have two ThreadPoolExecutors, one a normal one and one a 'priority' one and put all of the cutting tasks in the priority one 2) have a separate thread that keeps two queues, a normal and priority and continually monitors the ThreadPoolExecutor and gives it the correct job when it's needed. Is there a better approach here?
|
# ¿ Jul 31, 2009 15:38 |
|
|
# ¿ May 7, 2024 15:17 |
|
Is there a way to listen for keyboard events in a console app? It's fairly easy when using KeyListeners, but it looks like I can only use them on GUI apps.
|
# ¿ Jan 23, 2010 03:02 |