This is the mail archive of the cygwin-xfree@cygwin.com 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]

Help with fixing x2x...


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


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