Question: Write a program in c. A main thread creates 2 child threads. Main thread prints A. The first child thread prints B, and the other
Write a program in c. A main thread creates 2 child threads. Main thread prints "A". The first child thread prints "B", and the other child thread prints "C". How do we guarentee that "C" prints before "B" and that "B" prints before "A" using pthreads and semaphore. Meaning the print outs should be in this order "C", "B", "A". All threads execute concurrently. Please include a working code.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
