Hello there,
Take a situation like one task is unblocking by a queue got some item in it.
this event unblock the task put the task in ready state.
Call the context switching function.
Only this two things happens are is there any other things happening in this situation, and if any higher priority task is running at the time this unblocked task will wait for that high priority task to go to blocked state right?
That’s right. Context switching function in the sense that the scheduler runs to check for the next ready task to switch to and maybe finally switches the context to it if required.
Welcome to FreeRTOS Community Forums — thanks for contributing!
Yes, as you said:
If a higher-priority task is already running , and the unblocked task (e.g. by receiving an item in the queue) has lower priority , it will be placed in the ready list, but it won’t run immediately as the current higher-priority task continues running until it blocks, yields, or is preempted, where in that scenario, the context will not be switched to the unblocked task immediately after the item has been received.