home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!ark
- From: ark@athena.mit.edu (Andrew Kirmse)
- Subject: Main loop for multiple app contexts
- Message-ID: <1992Aug14.221823.15607@athena.mit.edu>
- Sender: news@athena.mit.edu (News system)
- Nntp-Posting-Host: w20-575-31.mit.edu
- Organization: Massachusetts Institute of Technology
- Date: Fri, 14 Aug 1992 22:18:23 GMT
- Lines: 24
-
- I'm looking for an efficient main loop to use in a program that uses
- several displays via multiple application contexts. Currently I poll
- continuously for events using something like:
-
- while (1)
- {
- for (i=0; i < num_apps; i++)
- {
- if (XEventsQueued(displays[i], QueuedAfterReading))
- {
- XtAppNextEvent(appcontexts[i], &event);
- XtDispatchEvent(&event);
- }
- else XFlush(displays[i]);
- /* background processing here */
- }
- }
-
- but this puts a large load on my machine. Can I perform a select() call on the
- display connection file descriptors? Or are there other ways?
- Please respond via email. Thanks!
-
- ---Andrew Kirmse
- ark@athena.mit.edu
-