3 ms·
Avoiding >NCPU threads is basically doing your context switching explicitly in code, rather than letting your OS and/or VM handle it. http://mailinator.blogspo
by andrewf 18y ago
Avoiding >NCPU threads is basically doing your context switching explicitly in code, rather than letting your OS and/or VM handle it.
http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-is-not-faster-than.html http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-...
Seems it isn't necessarily more efficient in many cases.
- axod 18y agoIt's certainly more tasteful IMHO, which should count for a lot. Spamming the CPU/OS with thousands of threads is just ugly. How can it not be? Networking should be event driven. It's like having a thread for each pixel on the display or each button...
- st3fan 18y agoYou speak in emotional terms like 'Tasteful' and 'Ugly'. Which makes a technical discussion about threading really difficult.
- axod 18y agoWell in technical terms, using threads can never be as efficient as not using threads. It can be equal, but not better. A lot of these things are a matter of taste though. If you think it's a thing of beauty to create 5,000 threads, then good luck to you :)