This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Help with fixing x2x...
- From: "Thomas Chadwick" <j_tetazoo at hotmail dot com>
- To: cygwin-xfree at cygwin dot com
- Date: Tue, 23 Jul 2002 17:00:25 -0400
- Subject: Help with fixing x2x...
- Bcc:
I recently discovered that when I run x2x, the Win2k Task Manager reports
that it's using 90-99% of the CPU.
While I have not noticed a slow down in performance when it's running, I'd
like to fix it if I can. I've poked around in the source and I don't like
the looks of the main loop:
while (True) { /* FOREVER */
if (fromPending = XPending(fromDpy))
if (ProcessEvent(fromDpy, &dpyInfo)) /* done! */
break;
if (XPending(toDpy)) {
if (ProcessEvent(toDpy, &dpyInfo)) /* done! */
break;
} else if (!fromPending) {
FD_ZERO(fdset);
FD_SET(fromConn, fdset);
FD_SET(toConn, fdset);
select(nfds, fdset, NULL, NULL, NULL);
}
It would appear to me that this constant polling for an event to process is
what's eating up the CPU cycles.
Not being an X programmer, I'm hoping someone monitoring the list can
suggest a way to modify this loop to be less of a CPU hog.
Thanks.
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx