• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

ThreadPool with different tasks

Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone. I have an information question. In my application the user sets the number of threads that should run a certain type of code( task).

in my source code there are 2 different type of tasks that needs to be run by the ThreadPool. information saved in a database by the first task is needed in the second task. Task are being added(scheduled) to the threadpool by a timer task that runs every 10 seconds.

So... my question is how is better to use:
a) One ThreadPool that runs those 2 different tasks. I already use this option but I have problems in balancing the scheduled number of tasks that will run in some future.
b) two threadpool one for every task -seems an easy option for me, but not such cleaner as the first( in my opinion)

If you think the solution from point a) is much better can you help me with some general information about how to build an balanced scheduled task system so on the threadpool should not run only the first or the second task.

Thanks in advanced
    Bookmark Topic Watch Topic
  • New Topic