Question: This problem studies the interaction between real - time scheduling and mutual ex - clusion, and was formulated by Kevin Weekly. Consider the following excerpt

This problem studies the interaction between real-time scheduling and mutual ex-
clusion, and was formulated by Kevin Weekly.
Consider the following excerpt of code:
1 pthread_mutex_t X; // Resource X: Radio communication
2 pthread_mutex_t Y; // Resource Y: LCD Screen
3 pthread_mutex_t Z; // Resource Z: External Memory (slow)
4
5 void ISR_A(){// Safety sensor Interrupt Service Routine
6 pthread_mutex_lock(&Y);
7 pthread_mutex_lock(&X);
8 display_alert(); // Uses resource Y
9 send_radio_alert(); // Uses resource X
10 pthread_mutex_unlock(&X);
11 pthread_mutex_unlock(&Y);
12}
13
14 void taskB(){// Status recorder task
15 while (1){
16 static time_t starttime = 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 Programming Questions!