We've got a real-time linux user application which communicates with another application running on the same host via mkfifo()
FIFOs. Our application consists of 4 pthreads, and one of these creates and opens the FIFOs. The FIFOs are opened in non-blocking (O_NONBLOCK) mode.
write()
on the pthread to the output FIFO typically take approx. 8 microseconds - this is for messages up to about 2500 bytes. The problem for us is that occasionally, but regularly, it takes 10 times that, and very infrequently it takes milliseconds. The message length isn't any longer than usual when this happens.
Presumably there's something going on 'under the hood' that causes this. Is there some way of avoiding it? It wouldn't matter if the average write()
time increased somewhat, as long as we didn't see the very long times.
Any comments/suggestions gratefully received.