Hi,
I don't want to disturb this interesting discussion,
and I also have the opinion that we need a reasonable, easy to use multitasking with the next Teensy model at the latest.
Nevertheless, I would like to mention briefly, at least, an alternative option that we already have today - and use it without being aware of it - I'm always a fan of unconventional solutions:
We have almost everything already, and even "free" and really fast: The ARM and the interrupt controller (do not laugh).
Every beginner already uses several tasks without realizing it. Like the systick. This can be extended without problems, if you don't leave the thinking to an OS but do it yourself
Let's just use a timer - e. g. the existing "intervalTimer". This can start our "Task" on a regular basis. If we set the interrupt priority to 255 (the lowest), we have our main task.
loop () of Arduino is now our idle-task. Idle () always runs when no other task (interrupt) is running - completely automatically, without another line of code.
There are also software interrupts (all of them in the ARM Cortex that are not needed for the hardware at the moment - so a lot of them! If we assign the same interrupt priority to them and start them appropriately, we automatically have a "RoundRobin"because they are processed one after the other.
Of course, this can also be done with other interrupts.
At the same time, you can add higher prioritized tasks at any time without having to mix anything up. If you raise the whole one or two interrupt levels, you can make it very complicated and structured. Only if you want to.
without changing anything in Arduino, without library.
A delay () of a low-priority task is automatically interrupted - you don't even have to think about it - or even write code.
You can jump out of your task and be "cooperative" with a simple "return;"
If you want, you can pause individual tasks by switching them off in the interrupt controller (easy to use already existing macros)
I have been using this system for some time now, and I am very happy with it. The only "problem" are shared resources - like I2C - but you can find a solution to it relatively quickly (honestly: I haven't needed this yet - how often does it happen that two tasks need I2C - this can be taken into account during the program design. Just THINK
My current project spends 99% of the time in a very long interrupt (+ higher priority ones), and calls in loop () almost only "WFI" and a few small routines to control the main task - that saves power.
Just take it as independend idea.
Edit: An "Event" is just starting a software-interrupt. It will run as soon as possible if no other tasks have priority. Again, no additional code needed.
So, now back to the actual topic please: -)
Please excuse my English.