From: Michael Witrant Date: 2001-09-28T00:45:03+09:00 Subject: [ruby-talk:21774] Re: opening a named pipe? On Fri, 28 Sep 2001 00:32:49 +0900, Matt Armstrong wrote: > In article <20010927154414.00ea6eca.mike@lepton.fr>, Michael Witrant wrote: > > I'm dealing with nearly the same issue: > > In the main thread of my script, I would like a loop to open and read > > a named pipe forever. It starts some new threads to handle commands > > received from the pipe. But all other threads stop running when the > > main thread is opening the pipe for reading. > > In Ruby, all threads are in the same unix process. If one thread blocks > on a unix system call (such as doing a blocking read from a pipe), the > whole process is blocked and no Ruby threads run. > Do you mean there is no way for ruby to run anything else while it is waiting for a pipe? Is waiting for a pipe different from reading a file, calling 'system', or any other blocking system call? My ruby threads usually run normally even if any other thread is waiting for a file, or sleeping for any reason (including system calls). Why is this different when I open a named pipe? Mike.