• Post Reply Bookmark Topic Watch Topic
  • New Topic

ThreadPool with different tasks  RSS feed

Doua Beri
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • 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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!