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 &
In reply to Re: named pipe and "Text file busy"
by sgt
in thread named pipe and "Text file busy"
by finpro
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |