From: "NAKAMURA, Hiroshi" Date: 2003-10-04T21:49:24+09:00 Subject: Re: webrick, threads, and i/o Hi, > From: "Ara.T.Howard" > Sent: Saturday, October 04, 2003 3:13 PM > my earlier post could have used an example, here is an example of where > blocking in one request seems to block the entire server: I didn't check the article, but... > fifo = open 'fifo', 'r' > res.body = fifo.read You open fifo with blocking mode and read here. Blocking entire process here is expected behavior if I understand correctly. > fifo = open 'fifo', 'w' > msg = "%s:%s" % [self.class, Time.now.to_s] > fifo.puts msg > now, if you run this and then point your browser at > > http://127.0.0.1:2003/time > > you will see the time. however, if you then try one, or more, of the > following in any order > > http://127.0.0.1:2003/read > http://127.0.0.1:2003/write I think the process is blocked at the second access. Does third access works? > you will see ALL windows hanging. does this make sense? how does one go > about designing servlets which will then block, like POST servlets, in a way > that would not block the entire webserver? You can open fifo with File::RDONLY|File::NONBLOCK for read side and File::WRONLY|File::NONBLOCK for write side. I think it should work. In other words, if you want the server never blocks no matter what servlets do, you should use other process forking WWW server application, or should make your server using WEBrick as a toolkit. Regards, // NaHi