Question: 3) We need to design and implement a simulation for a making an exam through POSIX processes and Inter-Process Communication Techniques. The simulation works as

 3) We need to design and implement a simulation for a

3) We need to design and implement a simulation for a making an exam through POSIX processes and Inter-Process Communication Techniques. The simulation works as follows: 1. A process named Teacher will manage the whole simulation from the beginning till the end. 2. Teacher process uses fork/exec system calls to generate/load 10 Student processes. 3. Each Student process: a. waits a SIGNAL from the Teacher to start their exam. b. Once the Student receives a SIGNAL, it will start its exam by printing: My ID is 4122 and I started my exam C. The Student process will invoke sleep system API to sleep a random number selected between [10 30] seconds, in order to emulate different times for finishing the exam among different processes. d. Once the sleep is over for that process it will trigger a SIGNAL that it has finished the exam and it will print: "Student 4122 has finished" 4. The Teacher process will keep tracking the order of Student processes that have finished. 5. At the end of all Student processes, the Teacher process will announce the results of the exam as follows and terminate. Exam is over RESULTS ARE: Student of ID=4128 Finished First Student of ID=4122 Finished Second Student of ID=4126 Finished Third 3) We need to design and implement a simulation for a making an exam through POSIX processes and Inter-Process Communication Techniques. The simulation works as follows: 1. A process named Teacher will manage the whole simulation from the beginning till the end. 2. Teacher process uses fork/exec system calls to generate/load 10 Student processes. 3. Each Student process: a. waits a SIGNAL from the Teacher to start their exam. b. Once the Student receives a SIGNAL, it will start its exam by printing: My ID is 4122 and I started my exam C. The Student process will invoke sleep system API to sleep a random number selected between [10 30] seconds, in order to emulate different times for finishing the exam among different processes. d. Once the sleep is over for that process it will trigger a SIGNAL that it has finished the exam and it will print: "Student 4122 has finished" 4. The Teacher process will keep tracking the order of Student processes that have finished. 5. At the end of all Student processes, the Teacher process will announce the results of the exam as follows and terminate. Exam is over RESULTS ARE: Student of ID=4128 Finished First Student of ID=4122 Finished Second Student of ID=4126 Finished Third

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!