From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7652 invoked by alias); 8 Aug 2010 11:05:07 -0000 Received: (qmail 7642 invoked by uid 22791); 8 Aug 2010 11:05:06 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-fx0-f43.google.com (HELO mail-fx0-f43.google.com) (209.85.161.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 08 Aug 2010 11:05:01 +0000 Received: by fxm18 with SMTP id 18so6073372fxm.2 for ; Sun, 08 Aug 2010 04:04:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.113.5 with SMTP id y5mr15143511fap.93.1281265499014; Sun, 08 Aug 2010 04:04:59 -0700 (PDT) Received: by 10.223.149.82 with HTTP; Sun, 8 Aug 2010 04:04:58 -0700 (PDT) In-Reply-To: <4C5DD910.9050809@dronecode.org.uk> References: <4BDC3161.9070101@cornell.edu> <4BDDE5F1.9080204@cornell.edu> <4C2B8171.5020409@dronecode.org.uk> <4C5B08AE.4080902@pobox.com> <4C5DD910.9050809@dronecode.org.uk> Date: Sun, 08 Aug 2010 11:05:00 -0000 Message-ID: Subject: Re: Slow response to keypresses in xorg-server-1.8.0-1 From: Andy Koppe To: cygwin-xfree@cygwin.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-xfree-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-xfree-owner@cygwin.com Reply-To: cygwin-xfree@cygwin.com Mail-Followup-To: cygwin-xfree@cygwin.com X-SW-Source: 2010-08/txt/msg00045.txt.bz2 On 7 August 2010 23:07, Jon TURNEY wrote: > Hmmm, looking again at the implementation of select(), I don't immediately > see that when waiting on /dev/windows, it checks that the message queue h= as > old messages on it before waiting. =C2=A0The MSDN documentation for > MsgWaitForMultipleObjects() seems to says that messages which had arrived > before the last PeekMessage() etc. aren't considered new and so don't end > the wait? I think you're right, a call to PeekMessage is needed for proper select() semantics: it shouldn't block if data is available for reading. I think it's a good idea anyway though to drain the message queue before invoking select() on /dev/windows, except if there's a possibility that message handling blocks out events on other files for too long. That's because select() has a lot more overhead than PeekMessage. Andy -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/