X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=XJXZ7EFEES4ge4o2qDqVx3QaSb5/OJCHfU4gUWlfzTR sphUON5WPKGOdOsa+yp5bmEFEdLLTOVq8FXjM1q9s/rfD4BxkXCtvgfwwJtoLvkx 1YHKxqzx97UlB3Ur+2F9rmw+/L6ZO/toRcaJKjBbtWnrJ7k2/5YhuhWBmNKi4WmM = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; s=default; bh=v6nfwTmCcsKV/lP9gTSP79v1ySY=; b=OEUsnx5HLCdDpA/o2 VdlFJfE+PvbpH03mSJ2LmMWIQH/pz7YZ0mEVv4PgmU0iSp96+FcaoIqiTE3MZrYj U1pHyTcsrugwJnmEkJRyek6LEAYRSZf74LY8z+FLWIWZmgkO5lwNAcGxKeOHJCFZ m41RenRpDWfDOfEW58hE3TxWoo= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_40,SPF_PASS autolearn=ham version=3.3.2 X-HELO: conuserg007-v.nifty.com X-Nifty-SrcIP: [121.93.68.199] Date: Thu, 5 Mar 2015 20:24:56 +0900 From: Takashi Yano To: cygwin AT cygwin DOT com Subject: Re: Cygwin hangs up if several keys are typed during outputting a lot of texts. Message-Id: <20150305202456.9ac4815a9d590145e15f7ae2@nifty.ne.jp> In-Reply-To: <20150304181857.GM3213@calimero.vinschen.de> References: <20150228144019 DOT 0e4cfdb3a26bfac361b538e2 AT nifty DOT ne DOT jp> <20150228140251 DOT GA11124 AT calimero DOT vinschen DOT de> <20150302204502 DOT 39b3e03ad5084b0b5add5d10 AT nifty DOT ne DOT jp> <20150302144426 DOT GK3213 AT calimero DOT vinschen DOT de> <20150304203407 DOT 14008531b0fb63ad5c19a33f AT nifty DOT ne DOT jp> <20150304121952 DOT GL3213 AT calimero DOT vinschen DOT de> <20150304181857 DOT GM3213 AT calimero DOT vinschen DOT de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes On Wed, 4 Mar 2015 19:18:57 +0100 Corinna Vinschen wrote: > The result is the patch I attached to this mail. I'm not sure it's the > most feasible way to solve this problem, but it works pretty nicely for > me, including pasting big chunks (I tried a clipboard with about 70K > of data) while yes(1) is running. Thank you, Corinna. I have tried your patch. It nicely works for me, too. And your workaround is definitely better than mine. One small thing to be improved is here: + if (echo_cnt > 0 + && ReadFile (echo_r, outbuf, MIN (rlen, echo_cnt), &n, NULL)) echo_cnt returned by ::bytes_available() is actually not a number of bytes available in the pipe. This is because ::bytes_available() returns "nleft" instead of "navail" when "nleft" is non-zero. Therefore, "rlen" should be used here rather than "MIN (rlen, echo_cnt)". By the way, should we go to cygwin-developer mailing list? -- Takashi Yano -- 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