Hi, I work at a company that makes heavy use of event loops. I'll try to accurately convey what I know: From an efficiency standpoint, using event loops requires much less memory, but marginally more CPU time than threaded approaches. In terms of maintenance, you're essentially writing your programs in continuation passing style which means error handling is explicit everywhere. There are tools that allow you to hide…
Ask HN: Event loop vs. Threads
11–20 of 36 posts
Re: Ask HN: Event loop vs. Threads
#12Re: Ask HN: Event loop vs. Threads
#13Re: Ask HN: Event loop vs. Threads
#14Thought this was the definitive blog post on the issue: http://sheddingbikes.com/posts/1280829388.html "epoll is faster than poll when the active/total FD ratio is 0.6."
Re: Ask HN: Event loop vs. Threads
#15You've got a "lot of legacy C++ code", and it seems like you're just randomly deciding whether or not to port it. You're basing this decision not on measurement, team considerations, or the needs of your project. Instead you're soliciting opinions from random people on the internet on what is a very religious issue.
If you have problems with your code (performance, maintainability, debugging, whatever), then go fix that. Maybe switching to Node is the right thing to do. But you'd be a fool to make that decision based on something someone said on Hacker News.
Re: Ask HN: Event loop vs. Threads
#16If one of my developers posted something like this, I would fire them on the spot. You've got a "lot of legacy C++ code", and it seems like you're just randomly deciding whether or not to port it. You're basing this decision not on measurement, team considerations, or the needs of your project. Instead you're soliciting opinions from random people on the internet on what is a very religious issue. If you have problem…
Re: Ask HN: Event loop vs. Threads
#17If one of my developers posted something like this, I would fire them on the spot. You've got a "lot of legacy C++ code", and it seems like you're just randomly deciding whether or not to port it. You're basing this decision not on measurement, team considerations, or the needs of your project. Instead you're soliciting opinions from random people on the internet on what is a very religious issue. If you have problem…
Re: Ask HN: Event loop vs. Threads
#18Most developers with no background in electroncis do not understand asynchronuous paradigm : Transitions = factorial(state). In best case if they don't confuse states and transitions (wich is common) you'll end up with a spaghetti code where goto are replaced with callbacks on events. In common case they will make intricated state models without making the docs (state transition diagrams are a MUST have (like RFCs on…
Hey could you expand on this? I don't understand what you mean by transitions = factorial(state) and why this leads to spaghetti code when you confuse state and transitions.
Re: Ask HN: Event loop vs. Threads
#19If one of my developers posted something like this, I would fire them on the spot. You've got a "lot of legacy C++ code", and it seems like you're just randomly deciding whether or not to port it. You're basing this decision not on measurement, team considerations, or the needs of your project. Instead you're soliciting opinions from random people on the internet on what is a very religious issue. If you have problem…
The OP uses the word "we" implying some sort of team decision. And asks for references, implying this is still under research.
Re: Ask HN: Event loop vs. Threads
#20Thought this was the definitive blog post on the issue: http://sheddingbikes.com/posts/1280829388.html "epoll is faster than poll when the active/total FD ratio is 0.6."
Really not sure, why someone voted this down? The only open experiments on the issue of threads vs. events - at least I don't know of any other.