home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / 20598 < prev    next >
Encoding:
Text File  |  1992-12-29  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!enterpoop.mit.edu!bloom-beacon!INTERNET!dont-send-mail-to-path-lines
  3. From: thp@westhawk.UUCP (Timothy H Panton)
  4. Subject: Re: Xt and CPU usage
  5. Message-ID: <9212291106.AA13233@westhawk.uucp>
  6. Sender: daemon@athena.mit.edu (Mr Background)
  7. Organization: The Internet
  8. Date: Tue, 29 Dec 1992 11:06:49 GMT
  9. Lines: 28
  10.  
  11.  
  12. > Each application is driven by both the GUI and serialized data using
  13. > XtInputCallbackProc's.
  14.  
  15. > 2 applications will put CPU usage of a Sparc 2 at 97%, even when
  16. > completely idle with no serialized data input and no X events (GUI input).
  17.  
  18. At a guess I'd say you have your XtInputCallbackProc reading from a file.
  19. (as opposed to a socket or pipe or stream).
  20. The action of XtAppAddInput is deliberately loosely defined, on most UN*X
  21. systems it calls select() or poll(). If select()  replies "ready" for a given
  22. file descriptor then your XtInputCallbackProc will get called.
  23.  
  24. On most Un*X's select() for readability on an open file gives "ready" even
  25. if you are at the end of file. A (hack) way around this is to 
  26. popen("tail -f filename"); 
  27. and use the returned pipe instead of your file descriptor.
  28.  
  29. Other things to check for are timers and work procs. 
  30.  
  31. Tim.
  32. +----------------------------------------------------------------------------+
  33. |Tim Panton, Westhawk Ltd.  "Couldn't you make this a little easier for me?" |
  34. |Phone: +44 244 314800          "Nope. This is as easy as it gets."          |
  35. |Email: thp%westhawk.uucp@uknet.ac.uk                                        |
  36. |Paper: Westhawk Ltd. Archway House, Station Road, Chester. CH1 3DW. UK      |
  37. +----------------------------------------------------------------------------+
  38.  
  39.