From: Vidar Hokstad Date: 2006-11-05T19:00:15+09:00 Subject: Re: Nonblocking IO read ara.t.howard@noaa.gov wrote: > it's exactly things like eventmachine that make me say using nbio is archaic - > i don't need to handle the complexities of nbio when powerful abstractions > like it exist! The problem is that all of these "powerful abstractions" are ridiculously slow compared to a well written nbio approach for many types of applications. Particularly as long as Ruby's threading is so abysmal. Try writing a network server that needs to handle a high number of concurrent connections, and you'll quickly find "select()" taking most of your CPU if you use a model that makes use of threading and blocking IO - your only real choice to get decent performance out of Ruby for that kind of app is multiplexing the processing manually using nbio (which is what Ruby is trying to do being the scenes, but fails miserably at doing effectively once the number of threads gets high enough) or fork instead which has it's own problems if you need to share significant state. This is from personal experience - I currently have a guy on my team rewriting an important backend process because we started running into those exact issues. Even when Ruby's threading is sorted out so we won't run into these problems, nbio will be vital for high performance network programming - well done nbio reduces the number of syscalls, and thereby context switches enormously. Vidar