I need a way to release a bunch of queued/suspended threads at some point in the execution of function A (all at the same point) when a certain instruction executes in function B (updates a global variable those in function A would be using that is uninitialized otherwise).
I think that a semaphore could work, hypothetically, but in practice I’m not sure how to implement in this non-binary setting where I would like to release more than one (likely in the range of 16) threads after a certain instruction in another function executes.
Additionally, this sounds somewhat similar to the readers-writers problem, but I’m unsure how to extend it into my application.
If anyone has any ideas or experience with this, please let me know.
Edit: in C. Posix threads.
As an update, I may simply use a while(global-boolean) solution; though it would be nice if there were a way to suspend those threads in the meantime.