If your system consists of one very high priority task and a few medium priority
ID: 3590950 • Letter: I
Question
If your system consists of one very high priority task and a few medium priority tasks and one very low priority task and your RTOS uses a preemptive priority-based scheduler; answer the following questions:
9. In the scenario described here, what can you in your design so that the highest priority task relinquishes the CPU to the lowest priority task approximately every 20 seconds? We are assuming that RTOS supports priority inheritance.
A) Inside the lowest priority task call the sleep function: sleep(20sec).
B) Inside the highest priority task call the sleep function: sleep(20sec).
C) Make the high priority task to wait inside the main loop for 20 seconds using an sleep call and then wait for an event that can only be generated by the lowest priority task.
D) Design a timer task management so that timer handlers are executed in the context of the task that creates the timer. Have the highest priority task to create a recurring timer that expires every 20 seconds. Then inside the timer handler wait for an event that can only be generated by the lowest priority task.
E) Design a timer task management so that timer handlers are executed in the context of the timer task. Have the highest priority task to create a recurring timer that expires every 20 seconds. Then inside the timer handler wait for an event that can only be generated by the lowest priority task.
Explanation / Answer
Answer:-
E) Design a timer task management so that timer handlers are executed in the context of the timer task. Have the highest priority task to create a recurring timer that expires every 20 seconds. Then inside the timer handler wait for an event that can only be generated by the lowest priority task.