in reply to named pipe and "Text file busy"
There is a contract for the use of a named pipe. I will suppose un*xlike and to simplify I will not talk about non-blocking. For pipes the default is blocking.
So do you have a permanent reader? If you have a read-once reader the behavior you seem to be experiencing is *normal*. Can it be somehow that the pipe is opened by the two threads? Can you check with lsof or similar the processes that maintain a descriptor opened to the named pipe. If you had posted some code we might have been able to help better.
cheers --stephan% steph@ape (/home/stephan) % % cat reader.sh #!/bin/ksh trap 'exit 0' INT pipe=named_pipe outfile=out [[ -p $pipe ]] || mkfifo $pipe exec 0<$pipe while dd if=$pipe bs=64 count=1 >> $outfile do print .processing sleep 2 done % steph@ape (/home/stephan) % % jobs [1] + Running ./reader.sh &
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: named pipe and "Text file busy"
by finpro (Novice) on Nov 26, 2007 at 20:56 UTC | |
by sgt (Deacon) on Nov 28, 2007 at 00:20 UTC |
In Section
Seekers of Perl Wisdom