1 Solved Topic

Remove Filter
Member Avatar for
Member Avatar for nikolaos

In the following example two threads share int counter. The increment_thread thread increases counter by one . The decrement_thread thread decreases counter by one . I use semaphore to control access to counter instead of making the two methods synchronized. Is this the proper way of using semaphore? When should …

Member Avatar for nikolaos
0
383

The End.