This looks a lot like various cooperative threading libraries I've seen. You basically set up a bunch of different stacks and pretend that each one is a new thread. Context switching is just a longjmp - it's significantly faster than a real context switch and significantly easier to code for as well, since you don't have any problems with sharing data between threads. Multithreading is much easier when you get to say when and where context switches can take place.
I don't agree with Ingo Molnars assertion that one should aim to either make something as simple or as fast as possible and never anything in between, I've found cooperative threading to sometimes offer a very nice tradeoff between the two.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds