3 ms·
Quote from Wikipedia article on Green Threads: "Linux native threads have slightly better performance on I/O and context switching operations." Some of the act
by lgunsch 12y ago
Quote from Wikipedia article on Green Threads: "Linux native threads have slightly better performance on I/O and context switching operations."
Some of the actual context switch in native threads is performed by the CPU, where as with green threads it is not. On top of this, the whole stack is copied upon a context switch.
- ptx 12y agoThe paper[1] cited for that quote is specifically about PersonalJava 1.1.3 on Linux 2.2 on PowerPC. It may not be relevant to implementations from this century. [1] http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.8.9238&rep=rep1&type=pdf http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.8.9...
- imanaccount247 12y agoYour quote lacks the context which makes it clear that it is not a general claim. >Some of the actual context switch in native threads is performed by the CPU, where as with green threads it is not Exactly. Native threads have a context switch, green threads don't.
- SamReidHughes 12y agoWikipedia is wrong and generally speaking you shouldn't trust it on CS matters. Or any other subject, really. Green thread context switching is much faster than native thread switching, as long as you don't do it badly. For example, on Linux, don't use setcontext/swapcontext/etc, because they do a system call to change the signal mask.