The output should look like: Child 1 PID: 113 Child 2 PID: 114 Beginning 3 Round
ID: 3595448 • Letter: T
Question
The output should look like:
Child 1 PID: 113
Child 2 PID: 114
Beginning 3 Rounds...
Fight
------------------------------
Round 1:
Child 1 throws Scissors!
Child 2 throws Rock!
COASTAL CAROLINA UN VERSITY Department of Computing Sciences CSCI 356- Operating Systems Homework Assignment #4 Due: Thursday, October 19, 2017 Name CCU ID: In this project, you will write a program that uses multiple threads (POSIX threads) to complete a task. Name your program (trpc.c) which will implement the rock, scissors, paper assignment from Homework #3 using p threads. The IPC mechanism that you will use is shared memory, since memory is easily shared between threads The main issue with using pthreads/shared memory over a fork/message passing solution is with the need for synchronization between the different threads. You should use a pthread condition variable to synchronize the parent and children threads. The output from this project should be identical to the last project (HW #3), except that the PID printed should be the thread identifier value (TID) You should also ensure that at the completion of the game, both child threads re-join parent thread before exiting. CSCI 356-Homework Assignment #4 Page 1