Question: Write program in C language using Pthreads API to simulate the real problem, the Sleeping Teaching Assistant, using what we have studied IPC and synchronization.

  1. Write program in C language using Pthreads API to simulate the real problem, the Sleeping Teaching Assistant, using what we have studied IPC and synchronization. Refer to Section 5.9.4 for specific instructions on mutex lock and semaphore.
  2. If there are multiple files in your submission, you need to provide a makefile.
  3. Include the compilation command with required options at the very beginning of your code.

he Sleeping Teaching AssistantA university computer science department has a teaching assistant (TA) whohelps undergraduate students with their programming assignments duringregular ofFce hours. The TAs ofFce is rather small and has room for only onedesk with a chair and computer. There are three chairs in the hallway outsidethe ofFce where students can sit and wait if the TA is currently helping anotherstudent. When there are no students who need help during ofFce hours, theTA sits at the desk and takes a nap. If a student arrives during ofFce hoursand Fnds the TA sleeping, the student must awaken the TA to ask for help. If astudent arrives and Fnds the TA currently helping another student, the studentsits on one of the chairs in the hallway and waits. If no chairs are available, thestudent will come back at a later time

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!