lets say I have 50 threads waiting one value. the one value is generated by the 51st thread at a random time. So the value is global and shared accross all threads. whats the best approach for the 50 threads to keep checking for the value? My goal is they all get the value at the same time as soon as thread 51 generates it. do you suggest a while loop? but that could clog the program becasue 50 while loops with no sleeps are a lot. Do you suggest locks? what do you suggest?
my program is in node and Im using async functions.
Hi,
Looks like you need some Event triggered to 50 processes when the value is generated. I agree running while cycles is a bad Idea.
Let's have a quick chat for further details.
Thanks!