Question: Write a multithreaded program which creates two threads: print thread and decrement thread. The program creates 100 instances of decrement thread. The decrement thread will
Write a multithreaded program which creates two threads: print thread and decrement thread. The program creates 100 instances of decrement thread. The decrement thread will decrement the count by 1. When the count has become 0, the print thread will print a message All 100 threads have decremented the counter. Implement this barrier with the help of POSIX semaphores. Also use POSIX semaphores wherever required. Do not use wait statement
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
