From: "David G. Andersen" Date: 2004-10-06T04:35:11+09:00 Subject: Re: Thinking about Threaded IO On Mon, Oct 04, 2004 at 09:38:57AM +0100, Brian Candler scribed: > > > > The former caused (all of) Ruby to block. The latter > > was handled properly. I _assume_, but didn't verify, > > that this is because Ruby was doing something like > > > > select() > > read(foo) > > > > internally > > Essentially that's right. Was there any reason to use 'sysread' rather than > 'read'? I think that > > mybuf.sbuf += s.read(65536) > > probably would have worked as you'd expected. Think so too. I don't remember why I switched it to sysread - I think I was having problems telling ruby to read as much as possible from the file descriptor without blocking, and I didn't want to have to make it explicitly nonblocking and abandon the happiness of threads. -dave -- work: dga@lcs.mit.edu me: dga@pobox.com MIT Laboratory for Computer Science http://www.angio.net/