Multiple threads block on a single object – howto?

Hi, How do I deal with a scenario in which several threads can run only after another thread already run (something similiar ManualResetyEvent in .NET). I need to run some threads initialization code (the part before the while(true)) only after a ‘service thread’ completed its initialization. Counting sempahore is not good as I don’t know the number of blocked threads … Thanks

Multiple threads block on a single object – howto?

If this is part of your initialisation then the easiest way would be to not create the other threads until after the event they want to wait for has completed. Alternatively you could use an event group – but that could be overkill.

Multiple threads block on a single object – howto?

Hi Richard,
I’ll create the other threads as part of the service thread’s initialization as you suggested. Thanks !!