What is the difference between Critical Regions and Scheduler tasks in Embedded applications?
In Critical Region, where both interrupts and scheduling are completely disabled
A scheduler lock disables the scheduler but still leaves interrupts enabled.
Critical regions can be used in thread level and ISR level to protect data that can also be modified by an ISR
Scheduler can be used only at thread level. This has the benefit that interrupts can still occur, so interrupt latency is not affected, but holds-off pre-emption by all other threads until the scheduler lock is removed