3 ms·
It's hard to say from the article, but is the first example single threaded? If so, then yes, adding more threads is of course going to speed it up. However, t
by deathanatos 11y ago
It's hard to say from the article, but is the first example single threaded? If so, then yes, adding more threads is of course going to speed it up.
However, they don't each need their own queue; epoll supports being polled by >1 thread. In such a setup _any_ thread available can handle any request; in the author's setup, you're going to need to make sure any particular thread doesn't get too bogged down if the requests are not equal. (That pick function is important.) I'd be more curious how those two compared. (The author's is certainly slightly easier to write, I think.)
- geocar 11y agoIf you can get into cache and stay there, you can enjoy 100x or even 1000x speedup. Having your CPU do a lot of different things is a good way to get out of cache :)