Multitasking and use of mutex
Posted: Sun Jun 21, 2020 1:19 pm
Hello,
I'm trying to get familiar with using multiple tasks on the Esp32 to avoid tasks blocking eachother. Now I understand that a mutex should be used when accessing the same resources, but it is not clear for me at what level that should take place.
Let's say there are three tasks:
- mqtt
- webserver
- general WiFi access
Al of them are using the WiFi resource at some point. Should a mutex be created that prevents accessing the WiFi resource, or is it on for example the mqtt level enough?
I'm trying to get familiar with using multiple tasks on the Esp32 to avoid tasks blocking eachother. Now I understand that a mutex should be used when accessing the same resources, but it is not clear for me at what level that should take place.
Let's say there are three tasks:
- mqtt
- webserver
- general WiFi access
Al of them are using the WiFi resource at some point. Should a mutex be created that prevents accessing the WiFi resource, or is it on for example the mqtt level enough?