The main advantage of having something like this is to be able to perform better when you have a piece of code handling communication (via Serial, Cloud, etc) and another piece of code making sure that your UI is handled well (Button reads, LEDs, Switched inputs, feedback loops) etc.
I want to see if any one has suggestions / comments before I get on a journey to start implementing/designing something like this.
On the Core, the scheduler looks like a good solution. It’s co-operative scheduling so your code would need to be written to call yeild() at appropriate points.
On the Photon, we already have pre-emptive multitasking from FreeRTOS. 0.4.6 will come with multithreading support available in the system firmware, and with the ability to create your own threads.
I am already aware of the IntervalTimer Library and it makes perfect sense to re-use it to dedicate a timer to a scheduler and have tasks called from there. I am still haven’t figured out all the details yet, but would ideally go with this idea.
I am actually more interested in the Photon(since it has a few more timers available) and looking forward to the multi-threading library.
Is there an expected release date for 0.4.6? Also, i’d be more than happy to beta test and compile it locally if you can point me to a branch on which it exists/would exist.
I checked out the branch, but can’t figure out the usage.
Any tips on what header I should include? and what functions/examples I can use in setup() and loop() to see how mutli-threading can be used? Really appreciate your help!