delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/10/02/15:15:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=BAYES_05,KHOP_SPAMHAUS_DROP,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE
X-Spam-Check-By: sourceware.org
X-Eon-Dm: dm0215
X-Eon-Sig: AQMoEGNQaz1anP4nWQIAAAAB,dc183e655bdce973aa30eb4d9926c9d7
From: bob <bob AT icanprogram DOT com>
To: cygwin AT cygwin DOT com
Subject: Fifo blocking and performance issues
Date: Tue, 02 Oct 2012 15:15:37 -0400
Message-ID: <2415374.xBCzgxA7JH@bob-kubuntu>
User-Agent: KMail/4.8.5 (Linux/3.2.0-31-generic; KDE/4.8.5; x86_64; ; )
MIME-Version: 1.0
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.7.7855,1.0.431,0.0.0000 definitions=2012-10-02_04:2012-10-02,2012-10-02,1970-01-01 signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001 definitions=main-1210020210
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

We are continuing our long drawn out effort to port the SIMPL toolkit 
(http://www.icanprogram.com/simpl) 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 
descriptor.

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.

bob

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019