Anyone have any modern resources on why green threads are considered "better" than OS threads? Presumably the answer has to be deeper than just allocating stack? I would expect that the OS scheduler is generally better at this than the VM (if not why haven't we fixed this?)
-
-
Replying to @sgrif
Look at the numbers in http://www.linuxplumbersconf.org/2013/ocw/system/presentations/1653/original/LPC%20-%20User%20Threading.pdf …
1 reply 0 retweets 1 like -
Replying to @pcwalton
This is focused on the cost of context switching, which is entirely costs that live at the scheduler, right? Is there a reason we can't just improve OS/CPU schedulers in the same way?
3 replies 0 retweets 0 likes -
The cost of switching OS contexts (kerneland / userland) is not only code, it's CPU registers which will trash the Instruction cache and data cache, move the MMU boundaries, etc. See http://wiki.osdev.org/Context_Switching … and http://wiki.osdev.org/Multitasking_Systems …
1 reply 0 retweets 0 likes
That isn’t the problem here. switchto does a CPU level context switch as well, and look at the graph in the LPC presentation.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.