0
votes

A little question about the freeRTOS task scheduler:

Is the task scheduler called inside the xQueueSend function or is it call at the next system tick?

1
I hate answering the same question in multiple places so will just post a link to my previous answer sourceforge.net/p/freertos/discussion/382005/thread/f0cb1a73 (which will also appear in the support forum archive at the end of the week). - Richard

1 Answers

0
votes

FreeRTOS will always run the highest priority task that is able to run. That means if you use a queue, semaphore, direct to task notification, event group, mutex, (anything else?), in such a way that another task unblocks, and the task that was unblocked has a priority higher than the running task, then the scheduler will switch to the unblocked task. The exception to that is if the application writer has locked the scheduler by calling vTaskSuspendAll(), in which case the unblocked task will be held pending until such time that the application writer calls xTaskResumeAll() - in which case the highest priority task that is able to run will start to run immediately (before the call to xTaskResumeAll() returns even).