This is the mail archive of the cygwin-xfree mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Slow response to keypresses in xorg-server-1.8.0-1


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 has
> old messages on it before waiting. ÂThe 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]