What is the difference between concurrency and parallelism?
Concurrency means multiple tasks make progress over a period of time, but they do not necessarily execute at the same physical instant. On a single-core processor, concurrency is achieved through time-slicing — the scheduler rapidly switches between tasks, giving the illusion of simultaneous execution. Parallelism means multiple tasks literally execute at the same instant on different processor cores.
In embedded systems, most MCUs are single-core, so you get concurrency but not parallelism. An RTOS scheduler on a single-core Cortex-M4 provides concurrency: the highest-priority ready task runs, and lower-priority tasks run when higher-priority tasks block or yield. True parallelism requires multi-core MCUs (e.g., dual-core ESP32, RP2040, or multi-core Cortex-A systems), which introduce additional complexity like cache coherency and cross-core synchronization.
The practical implication is that on a single-core RTOS, you do not need to worry about two tasks executing the same critical section at literally the same time — disabling interrupts or using a mutex is sufficient. On a multi-core system, disabling interrupts on one core does not prevent the other core from accessing shared data, so you need spinlocks or cross-core synchronization primitives.
Source: Operating Systems & RTOS Q&A
