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.
- 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.
- If there are multiple files in your submission, you need to provide a makefile.
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started