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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!