what is Counting Semaphore?
问题 Hi I did get how the Counting Semaphore works? Please help me in understanding. As per my understanding if we set count as 3, then process can use 3 threads to access the resource. so, here just 3 threads have access on the resource. When 1 thread leaves the other waiting thread comes in. If my understanding is correct, these 3 thread can corrupt shared data too. Then what is use of it? 回答1: Your observations are correct; typically a resource either needs to be restricted to one thread (e.g.