From: Carlos Date: 2001-09-28T00:50:05+09:00 Subject: [ruby-talk:21775] Re: opening a named pipe? > 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. Is there any reason why open disable other threads > when it's waiting for the pipe? > I would like to open the pipe in blocking-mode, while running other > threads. I'm afraid you will have to open the pipe in non blocking mode and poll for the data. If I'm not mistaken, Ruby's current threads implementation makes the whole process to wait until the syscall returns, not just the thread. Maybe you can try opening the pipe non blocking, use fcntl to set SETSIG and use trap(signal) to do the readings, if you want to avoid to waste cpu in polling...