From: Bill Kelly Date: 2004-11-27T03:09:46+09:00 Subject: Re: [ANN] Multiplexer - linear non-blocking I/O From: "Mikael Brockman" > > "Robert Klemme" writes: > > > server = TCPServer.new 12345 > > > > loop do > > Thread.new(server.accept) do |a| > > begin > > data = "foo" * 10000000 > > a << data > > ensure > > a.close > > end > > end > > end > > You're right, but I get the same results. Only one client at a time is > accepted. Strange... I'm surprised there are too many differences between your select multiplexer using continuations and a threads solution, since: a) ruby uses select() to multiplex behind the scenes when multiple threads are doing I/O; and b) ruby continuations are implemented using threads. That said I haven't studied your continuations solution so maybe my surprise is misplaced... But I wrote this simplistic threaded socket IO performance test last month http://bwk.homeip.net/ftp/ruby/tcptest.rb and I've watched it accept and handle 100+ clients without delay. Each client is pushing bytes as fast as it can (at the specified chunk size), and each server thread handling a client is in return replying with bytes as fast as it can. . . . Just chiming in in case this is somehow helpful... if not, please disregard. =D Regards, Bill