How to block a group of threads in Java

229 Views Asked by At

I have a task in which I have to read data using different threads.

The problem is that due to the limitation of read rates, I built different threads with thread groups.

Now can any one tell me how to sleep one entire thread group so that it begins execution from exact same place where it left and the other thread groups remain executing?

1

There are 1 best solutions below

0
On BEST ANSWER

Without having more details it sounds like you might need to look into using a CyclicBarrier or a CountDownLatch. They won't operate at the ThreadGroup level but may provide the common wait point you are looking for.