home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / fj / maillis / xwindow / 18955 < prev    next >
Encoding:
Internet Message Format  |  1992-12-29  |  1.9 KB

  1. Path: sparky!uunet!spool.mu.edu!sdd.hp.com!sgiblab!nec-gw!nec-tyo!wnoc-tyo-news!scslwide!wsgw!wsservra!onoe
  2. From: westhawk!thp@scslwide.sony.co.jp (Timothy H Panton)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: Xt and CPU usage
  5. Message-ID: <1992Dec29.132906.23846@sm.sony.co.jp>
  6. Date: 29 Dec 92 13:29:06 GMT
  7. Sender: onoe@sm.sony.co.jp (Atsushi Onoe)
  8. Distribution: fj
  9. Organization: Workstation Div., Supermicro Systems Group, Sony Corporation
  10. Lines: 32
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: Tue, 29 Dec 92 11:06:49 GMT
  14. Message-Id: <9212291106.AA13233@westhawk.uucp>
  15. X-Sun-Charset: US-ASCII
  16. Content-Length: 1337
  17.  
  18.  
  19. > Each application is driven by both the GUI and serialized data using
  20. > XtInputCallbackProc's.
  21.  
  22. > 2 applications will put CPU usage of a Sparc 2 at 97%, even when
  23. > completely idle with no serialized data input and no X events (GUI input).
  24.  
  25. At a guess I'd say you have your XtInputCallbackProc reading from a file.
  26. (as opposed to a socket or pipe or stream).
  27. The action of XtAppAddInput is deliberately loosely defined, on most UN*X
  28. systems it calls select() or poll(). If select()  replies "ready" for a given
  29. file descriptor then your XtInputCallbackProc will get called.
  30.  
  31. On most Un*X's select() for readability on an open file gives "ready" even
  32. if you are at the end of file. A (hack) way around this is to 
  33. popen("tail -f filename"); 
  34. and use the returned pipe instead of your file descriptor.
  35.  
  36. Other things to check for are timers and work procs. 
  37.  
  38. Tim.
  39. +----------------------------------------------------------------------------+
  40. |Tim Panton, Westhawk Ltd.  "Couldn't you make this a little easier for me?" |
  41. |Phone: +44 244 314800          "Nope. This is as easy as it gets."          |
  42. |Email: thp%westhawk.uucp@uknet.ac.uk                                        |
  43. |Paper: Westhawk Ltd. Archway House, Station Road, Chester. CH1 3DW. UK      |
  44. +----------------------------------------------------------------------------+
  45.