I have two processes and one named pipe.
One process is actively reading from the pipe, and one process is sending data to the pipe continously.
The command that sends to the pipe is the following :
sudo iotop -b -P > diskfifo
The reader on the other hand is simply performing a loop read operation on the pipe
pipe=./diskfifo
while read line <$pipe
do
if [[ "$line" == 'quit' ]]; then
break
fi
echo $line
done
Problem : the iotop command sometimes stops after a certain number of iterations and I can't figure out why.
However, I noticed that if I reduce the amount of data sent the iotop command does not stop.