Fibrils and asynchronous system calls
Posted Feb 1, 2007 16:47 UTC (Thu) by liljencrantz
Parent article: Fibrils and asynchronous system calls
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.
to post comments)