Chat freely about anything...

User avatar
By helpme
#53343 EspressIf has 2 kinds of SDK - NonOS and RTOS. Arduino uses NonOS. RTOS is new. What are the pros and cons of the 2 SDKs? Which SDK is going to get more support by EspressIf going forward?
User avatar
By martinayotte
#53367 RTOS SDK isn't new. The first release was done around the same time as the first NonOS, about almost 2 year ago. during those 2 years, about 15 releases has been done for NonOS while around only 3 or 4 for the RTOS.
So, definitively, RTOS has less support and less resources from Espressif.
Things will maybe change in the future since the RTOS ESP32 will be the only one (there is no NonOS for ESP32), and some people said that this RTOS ESP32 will probably be back ported to ESP8266.
User avatar
By Oleg Gerasimov
#53526 Here is my general decisions about RTOS vs NonOS

The main goal of most RTOS-es - bring preemptive multitasking/multithreading.

Multithreading allows us to write clean and linear code without trillions of async callbacks, and complex state graphs.
It is very helpful for c/c++ programs, because c/c++ have poor support of async programming. c++11 lambdas make c++ bit better for asyncs. But modern c++ have too complex syntax itself.

But preemptive multithreading is very dangerous, because we have remember about thread synchronization. There are many side effects: deadlocks, bottle necks, race conditions and etc. Also many 3-rd party libraries are not thread safe, and calling them from different threads can crash your program in random places.

So preemptive multithreading is good choice only when you cleanly understand, how them working, and have strong experience with them.

I think, that cooperative multitasking is optimal choice. Have a look to coroutines libraries. They are also allows us to create linear code, but there no most side effects of preemptive multithreading, because we can control context switch.

In terms of Arduino core library i think, that NonOS is anough and safe. Remeber, that RTOS can bring additional bugs.