mardi 7 février 2017

How can I make a thread wait until another thread is wating (C#)

Vote count: 0

I have a consumer thread that creates some worker threads. These threads must switch between active and waiting states. When all worker threads are in the waiting states, it means that the current job is done. How can I make the consumer thread wait for all the worker threads to be in the waiting state? I want a behavior very similar to Thread.Join() on all worker threads, however, I want the threads to keep running for the next job. I cannot create new threads because the jobs are in a tight loop and creating new threads is costly.

asked 20 secs ago

Let's block ads! (Why?)



How can I make a thread wait until another thread is wating (C#)

Aucun commentaire:

Enregistrer un commentaire