Open viralmutant opened 1 year ago
The Barrier solution in 3.6.4 has a note towards the end:
It might seem dangerous to read the value of count outside the mutex. In this case it is not a problem, but in general it is probably not a good idea.
I did not understand why it is not a problem in this case. If all the threads signal() the barrier, then none of them will wait(), right ?
signal()
wait()
The Barrier solution in 3.6.4 has a note towards the end:
I did not understand why it is not a problem in this case. If all the threads
signal()
the barrier, then none of them willwait()
, right ?