4 ms·
Here's a nickel kid, go try out your ridiculous proposition. I'll wait while you pull the power plug and restart...
by blasdel 17y ago
Here's a nickel kid, go try out your ridiculous proposition. I'll wait while you pull the power plug and restart...
- btilly 17y agoYou have apparently misunderstood something here. Just because you are launching something that can scale to a million threads doesn't mean that it needs to spawn a million threads every time it spins up. But if it does spin up a million threads over time, the performance of your scheduler won't be your bottleneck. There will be lots of other big ones (memory, stack space, etc), but not scheduling overhead.
- jrockway 17y agoTry Coro; the overhead per coroutine is very low. I have some numbers in a HN comment from a few weeks ago... let me dig that up. Edit: here we are: http://news.ycombinator.com/item?id=794535 http://news.ycombinator.com/item?id=794535 (Thanks, SearchYC. I found this post with a signle query!)
- btilly 17y agoI'm replying to me because I don't have a reply button for jrockway's response. When you use the word "threads", most people are going to assume you mean OS threads because that is what most of the world means. Hence this subdiscussion with bladsel about having a lot of OS threads.
- jrockway 17y agoI think he thinks you think the alternative to lightweight threads is a process-per-connection. (I think you think that too.) BTW, you can reply to posts without the reply button by clicking "link" and typing in the resulting box. Yeah.
- btilly 17y agoIf you think that, then you think wrong. I am fully aware that there are plenty of alternatives to that model. I wouldn't choose to use them in Perl, but they exist. Which is why what I said earlier in http://news.ycombinator.com/item?id=866558 http://news.ycombinator.com/item?id=866558 (back when I thought that by "lightweight thread" you meant something like a thread in the JVM) boils down to, "Here is the standard way to do it in Perl. If you want to take this other type of approach using a similar class of scripting language, I would recommend one of these alternate implementations of Ruby or Python." Thanks for the tip on getting around the lack of a reply button.