T
Tomasz Wrobel
Hi,
in my program I'm creating a thread, in which I open a FIFO and read
data from it.
pipe_listener_thread = Thread.new(ARGV[0]) do |fifoname|
while true # loop to reopen fifo, when it ends because of no writers
fi = File.open(fifoname, "r")
while line = fi.gets
puts "msg: #{line}"
end
fi.close
end
end
Everything works fine, except that when the thread is waiting to open
the fifo, whole process - all threads seem to be blocked. Such thing
doesn't happen when waiting for data (inner loop) - where the thread
alone gets blocked.
Please tell, if there's something wrong with this behavior, or it should
work that way.
Regs,
Tomasz Wrobel
in my program I'm creating a thread, in which I open a FIFO and read
data from it.
pipe_listener_thread = Thread.new(ARGV[0]) do |fifoname|
while true # loop to reopen fifo, when it ends because of no writers
fi = File.open(fifoname, "r")
while line = fi.gets
puts "msg: #{line}"
end
fi.close
end
end
Everything works fine, except that when the thread is waiting to open
the fifo, whole process - all threads seem to be blocked. Such thing
doesn't happen when waiting for data (inner loop) - where the thread
alone gets blocked.
Please tell, if there's something wrong with this behavior, or it should
work that way.
Regs,
Tomasz Wrobel