Performance
On a multi-core processor, native thread implementations can automatically assign work to multiple processors, whereas green thread implementations normally cannot. Green threads can be started much faster on some VMs. On uniprocessor computers, however, the most efficient model has not yet been clearly determined. Benchmarks on computers running the (ancient) Linux kernel version 2.2 have shown that:
- Green threads significantly outperform Linux native threads on thread activation and synchronization.
- Linux native threads have slightly better performance on I/O and context switching operations.
When a green thread executes a blocking system call, not only is that thread blocked, but all of the threads within the process are blocked. To avoid that problem, green threads must use asynchronous I/O operations, although the increased complexity can be hidden by implementing separate native I/O processes which cooperate with green threads.
Read more about this topic: Green Threads
Famous quotes containing the word performance:
“The value of old age depends upon the person who reaches it. To some men of early performance it is useless. To others, who are late to develop, it just enables them to finish the job.”
—Thomas Hardy (18401928)
“O world, world! thus is the poor agent despised. O traitors and bawds, how earnestly are you set a-work, and how ill requited! Why should our endeavour be so loved, and the performance so loathed?”
—William Shakespeare (15641616)
“When a book, any sort of book, reaches a certain intensity of artistic performance it becomes literature. That intensity may be a matter of style, situation, character, emotional tone, or idea, or half a dozen other things. It may also be a perfection of control over the movement of a story similar to the control a great pitcher has over the ball.”
—Raymond Chandler (18881959)