Fifo blocking and performance issues

Tue Oct 2 19:15:00 GMT 2012

We are continuing our long drawn out effort to port the SIMPL toolkit 
( to the Cygwin platform.     For a long time 
we were unable to proceed due to issues with the fifo implementation under 
Cygwin.   These issues have largely been addressed in more recent Cygwin 
releases.    However, some curious and frustrating issues remain.

The most difficult remaining issue concerns the difference in blocking behavior 
of Cygwin RDWR fifos versus their Linux counterparts.   Under Linux you can 
open a fifo as RDWR and have it safely and conveniently block on the subsequent 
read if there is no information on the fifo (or no other partner on the other 
end).     Under Cygwin RDWR fifos block on the open call until the partner 
shows up.      We hacked around this "problem" by opening RDWR+O_NONBLOCK 
on Cygwin and then surrounding our reads with a selec()t on the file 
descriptor.    While this hack works the performance under Cygwin is orders of 
magnitude slower than the equivalent Linux performance.

Any suggestions on how we can achieve a higher performance blocking read on a 
Cygwin RDWR fifo?

The second issue is related.    The other end of these RDWR fifos is typically 
open WRONLY.     Most of the time the open does not block but occasionally we 
have found a condition where this open does block.    Early experimentation 
points to a condition whereby the fifo was previously opened and  written to by 
another process and where that process continues to have an open file 

Once again are there any good suggestions on how to avoid blocking on a 
multiplexed WRONLY fifo open?

The final issue concerns the select() hack described above.    When running our 
benchmark test which repeatly composes and sends a message,  we notice that 
occasionally (once every 50 times or so) the select releases but the 
subsequent read fails with errno 11 (resource temporarily unavailable).    If 
this error is "ignored" and the read retried things seem to work.

Any ideas?

Thanks in advance for your help.


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list