I have a bunch of runnables I want to run in multiple threads and some depend on others to complete before they begin. I wrote a simple utility to do this, but is there a library that already provides this capability?
You can use a CountDownLatch to coordinate the activites of threads
"some depend on others to complete before they begin".
I assume this means some tasks use results of other tasks as input arguments. If so, search for "java dataflow" or "java workflow".
If input arguments for each task can be represented with a single sequential queue, this special kind of dataflow is known as "Actor model", so search for "java actor library or framework".
In particular, an opensource project of mine df4j supports both dataflow and actor styles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With