From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3161 invoked by alias); 29 Aug 2010 15:09:10 -0000 Received: (qmail 3144 invoked by uid 22791); 29 Aug 2010 15:09:09 -0000 X-SWARE-Spam-Status: No, hits=3.0 required=5.0 tests=AWL,BAYES_00,DONT_USE_RAW_EMAIL_IN_BODY X-Spam-Check-By: sourceware.org Received: from exprod8og104.obsmtp.com (HELO exprod8og104.obsmtp.com) (64.18.3.88) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Sun, 29 Aug 2010 15:09:04 +0000 Received: from source ([12.108.188.134]) by exprod8ob104.postini.com ([64.18.7.12]) with SMTP ID DSNKTHp4DjgaXbkCYHiE8nio4ecJaJA9p8lP@postini.com; Sun, 29 Aug 2010 08:09:03 PDT Received: from PS23EXVCL02.informatica.com ([10.1.33.31]) by psb23eh01.informatica.com with Microsoft SMTPSVC(6.0.3790.3959); Sun, 29 Aug 2010 07:58:34 -0700 Received: from 10.1.32.52 ([10.1.32.52]) by PS23EXVCL02.informatica.com ([10.1.33.34]) with Microsoft Exchange Server HTTP-DAV ; Sun, 29 Aug 2010 14:57:54 +0000 References: <4BDC3161.9070101@cornell.edu> <4BDDE5F1.9080204@cornell.edu> <4C2B8171.5020409@dronecode.org.uk> <4C5B08AE.4080902@pobox.com> <4C5DD910.9050809@dronecode.org.uk> <4C7A62FD.10506@dronecode.org.uk> <20100829141716.GG6726@calimero.vinschen.de> <20100829144150.GI6726@calimero.vinschen.de> <20100829145041.GJ6726@calimero.vinschen.de> Message-ID: <75D6C200-C94D-4705-8D9A-5365EE0A2A28@informatica.com> From: "Trollope, David" To: In-Reply-To: <20100829145041.GJ6726@calimero.vinschen.de> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 (iPad Mail 7B500) Subject: Re: /dev/windows and select() [was Re: Slow response to keypresses in xorg-server-1.8.0-1] Date: Mon, 30 Aug 2010 11:23:00 -0000 Cc: , 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/msg00133.txt.bz2 We are listening and learning :-) Dave Sent from my iPad On Aug 29, 2010, at 9:51 AM, "Corinna Vinschen" = wrote: > On Aug 29 16:41, Corinna Vinschen wrote: >> On Aug 29 16:17, Corinna Vinschen wrote: >>> On Aug 29 14:39, Jon TURNEY wrote: >>>> On 08/08/2010 12:04, Andy Koppe wrote: >>>>> On 7 August 2010 23:07, Jon TURNEY wrote: >>>>>> Hmmm, looking again at the implementation of select(), I don't immed= iately >>>>>> see that when waiting on /dev/windows, it checks that the message qu= eue has >>>>>> old messages on it before waiting. The MSDN documentation for >>>>>> MsgWaitForMultipleObjects() seems to says that messages which had ar= rived >>>>>> before the last PeekMessage() etc. aren't considered new and so don'= t end >>>>>> the wait? >>>>> [...] >>>=20 >>> Thanks for the testcase. I examined this and I think I have a >>> workaround. MSDN states that there's a flag QS_ALLPOSTMESSAGE for >>> MsgWaitForMultipleObjects, which is not cleared by PeekMessage, if the >>> wMsgFilterMin and wMsgFilterMax arguments are not both 0. So, what I >>> did was to add the QS_ALLPOSTMESSAGE flag to the >>> MsgWaitForMultipleObjects call in select.cc, and to change the >>> PeekMessage call in select.cc:peek_windows() from >>>=20 >>> PeekMessage (&m, (HWND) h, 0, 0, PM_NOREMOVE) >>>=20 >>> to >>>=20 >>> PeekMessage (&m, (HWND) h, 1, UINT_MAX, PM_NOREMOVE) >>>=20 >>> Same in your above test application. This appears to do the trick. >>> However, I'm not exactly sure if that's a valid fix. Patch below. >>=20 >> Hmm, this ignores the potential WM_NULL message, afaics. For some >> reason, using >>=20 >> PeekMessage (&m, (HWND) h, 0, UINT_MAX, PM_NOREMOVE) >>=20 >> results in MsgWaitForMultipleObjects hanging, too. OTOH, using >>=20 >> PeekMessage (&m, (HWND) h, 0, 16, PM_NOREMOVE) >> && PeekMessage (&m, (HWND) h, 17, UINT_MAX, PM_NOREMOVE) >>=20 >> does not. Go figure. >=20 > Yeah, I realize I'm talking to myself, but this works, too: >=20 > PeekMessage (&m, (HWND) h, 0, UINT_MAX - 1, PM_NOREMOVE) >=20 >=20 > Corinna >=20 > --=20 > Corinna Vinschen Please, send mails regarding Cygwin to > Cygwin Project Co-Leader cygwin AT cygwin DOT com > Red Hat >=20 > -- > 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/ >=20 -- 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/