Preemptive multitasking is in the works

A project log for zeptoforth

A Cortex-M native code Forth with a kernel written in Thumb-2 assembly

Travis BemannTravis Bemann 10/20/2020 at 23:142 Comments

I still have some bugs to get out, but preemptive multitasking is currently being developed for zeptoforth. Ultimately, the goal is to have zeptoforth serve as an RTOS, which would be a distinguishing feature vis-a-vis the main option for Cortex-M Forth computing, Mecrisp-Stellaris. It may still be a bit before it is ready (currently it crashes after context-switching a few times), but once the bugs are out there will soon be a new release containing this new functionality. Note that the preemptive multitasker is backwards compatible to any older code that used the cooperative multitasker, provided code is added for critical sections.


Thomas wrote 10/21/2020 at 04:47 point

Nice! Do you still see use cases for Inner-interpreter based multitasking or will the preemptive approach replace the old one? 

  Are you sure? yes | no

Travis Bemann wrote 10/22/2020 at 15:18 point

The preemptive approach will replace the old one, but code can still relinquish control of the CPU with PAUSE. The main difference is that code may need to add critical sections, particularly in code pertaining to inter-task communication.

  Are you sure? yes | no