About threads and semaphores

Am I correct that all application code on the device is run on the same “application” thread? In other words, if I define a few Timers, and loop() etc, there’s no need to place any semaphores because there’s only a single thread that runs all of those?

Or under which circumstances might other threads be involved?


See if this clears anything up for you.


Yep, I read that. That’s what made me believe what I wrote above. That doesn’t make me correct, though, just attempting to validate …

Software Timers run in a separate thread, and in a thread with a really small stack, so it’s best to avoid putting much in a software timer callback. Other things, like subscription callbacks, function handlers and serial event handlers, all run from the loop thread.

“Really small”? (Won’t mind a pointer to the code)