Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!brunix!ivan.uucp!jhc From: jhc@ivan.uucp (James H. Coombs) Newsgroups: comp.windows.x Subject: XtAddInput() steals CPU Message-ID: <64966@brunix.UUCP> Date: 14 Feb 91 17:14:13 GMT Sender: news@brunix.UUCP Reply-To: jhc@ivan.uucp (James H. Coombs) Organization: IRIS - Brown University Lines: 21 I noticed that using XtAddInput() causes my application to consume CPU cycles constantly, even when there is no input. O'Reilly Vol. IV, p. 226 notes: Under the beta release of R4, the function registered with XtAddInput is called very frequently even when no new input is available.... It is difficult to tell whether this is a bug or the intended behavior.... Does anyone have good workarounds for this. (The behavior is unacceptable, whether intended or not.) I can just use my own asynchronous i/o, but I thought that the X model was to let the underlying layers handle the events. I also found that window updating was not very clean, probably because I was adding items to a list before X (Motif) had a chance to update fully. Perhaps I just need to flush the pending events before adding items from my interrupt routine. If I set SIGIO to my signal handler, however, I risk competing with X for those signals. It does not look as though X or Xt uses SIGIO, but that is not guaranteed is it? Any recommendations? --Jim