Do I need a mutex if two equal-priority tasks just share CPU time?

I gave a simple solution to the question that OP gave. In the real world nobody will notice if an LED is blinking at 501ms or even 510ms.

If you care more about timing you can add more code and use vTaskDelayUntil to get better timing. If you care even more than you setup a hardware interrupt, but that is a waste of resources for blinking an LED.

Also in general you do want code to be as interruptable as possible, otherwise how can a high priority task preempt a lower one?

1 Like