What problems does RTOS solve?
Tasks vs threads
What is priority inversion?
When a low-priority task is blocking a high-priority task
- priority inheritance is used to fix it
Mutex vs Semaphore
Mutex: exclusive resource locking.
- A thread or a task locks the mutex before going into a critical section
- unlocks the mutex when done indicating to other threads the critical section is available
Semaphore: signalling or counting; often used between ISR and task communication
- used for both synchronisation and mutual exclusion
What happens if an ISR takes too long?
How do queues work?
Tasks or ISRs can put data into queues and you can communicate that queue to other tasks