Multi:Threading - Is this the right approach?
Posted
by HonorGod
on Stack Overflow
See other posts from Stack Overflow
or by HonorGod
Published on 2010-03-26T15:22:22Z
Indexed on
2010/03/26
15:23 UTC
Read the original article
Hit count: 375
Experts -
I need some advice in the following scenario.
I have a configuration file with a list of tasks. Each task can have zero, one or more dependencies. I wanted to execute these tasks in parallel [right now they are being executed sequentially]
The idea is to have a main program to read the configuration file and load all the tasks. Read individual tasks and give it to an executor [callable] that will perform the task and return results in a Future. When the task is submitted to the executor (thread) it will monitor for its dependencies to finish first and perform its own task.
Is this the right approach? Are there any other better approaches using java 1.5 features?
© Stack Overflow or respective owner