Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
freertos: Remove/restore queue locks for multi-core/single-core
This commit removes the updates the usage of queue locks in IDF FreeRTOS Queue locks are present in Vanilla FreeRTOS to ensure that queue functions behave deterministicly in critical sections (i.e., no walking linked lists while interrupts are disabled). However, currently in IDF FreeRTOS... - When configNUM_CORES > 1, IDF FreeRTOS drops the determinism requirement. Thus, queue functions could be simplified if queue locks were not used at all (and have a queue function do everything inside the same critical section). - When configNUM_CORES == 1, the current queue implementation in IDF FreeRTOS does not meet the determinism requirements, as critical sections are used (instead of scheduler suspension) when locking/unlocking the queues. There, this commit updates multiple queue functions so that - When configNUM_CORES > 1 - Queue locks are no longer used. All actions are done within the same critical section. - Affected queue functions now need 40% less CPU clock cycles when blocking - When configNUM_CORES = 1 - Queue locks are still used. - Vanilla behavior of suspending the scheduler is restored when locking the queue. Thus queue fucntions are now deterministic and have the same behavior as Vanilla FreeRTOS. - Affected queue functions now takes 36% more CPU clock cycles when blocking (due to the scheduler suspension/resumption).
- Loading branch information