In a scenario with three tasks—High (H), Medium (M), and Low (L)—task L holds a mutex that task H is waiting for. If task M becomes ready to run, what mechanism ensures that task H is not delayed indefinitely by task M?
Task L’s priority is temporarily increased to match Task H’s priority
An application must manage access to a pool of three identical printers shared among multiple tasks. Which mechanism is the most appropriate to track resource availability and
prevent tasks from attempting to access a printer that is already in use?
A counting semaphore initialized to 3
Task A (high priority) attempts to read data from an empty queue using an xTicksToWait value of 100. Task B (low priority) is currently running. What happens at the exact moment
Task A calls the receive function?
Task A is placed into the Blocked state, and Task B immediately resumes execution.
A low-priority task sends an item to a queue. A higher-priority task is blocked waiting on that queue. When does a context switch occur?
Immediately after the send
A task calls xQueueSend() on a full queue using a non-zero timeout. What is the correct behavior?
The task is blocked
What happens when xQueueReceive() is called on an empty queue with a specified timeout?
The task is blocked
Which property of an RTOS queue is independent of task priority?
Order of stored items
What does the maximum count of a counting semaphore represent?
Number of available resources.
If a task fails to take a counting semaphore before the timeout expires, what must it do?
Handle the failure
Why is a binary semaphore not ideal for protecting complex critical sections?
It lacks priority inheritance.
Which condition is required for priority inversion to occur?
A blocking shared resource exists
Which mechanism allows a mutex to reduce the impact of priority inversion?
Priority inheritance
What happens after a task releases a mutex that caused priority inheritance?
Its priority is restored
Scenario:
Task 1 (high priority) is blocked because it is attempting to send data to a full queue. Task 2 (low priority) is currently running and removes an item from the same queue, thereby freeing space.
Question:
According to the scheduling mechanisms presented, which event occurs immediately after Task 2 calls the queue receive function?
Task 1 is unblocked by the scheduler and immediately preempts Task 2 to fill the freed space in the queue.