Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!snorkelwacker.mit.edu!bloom-beacon!dont-send-mail-to-path-lines From: adrian@spike.ora.COM (Adrian Nye) Newsgroups: comp.windows.x Subject: Re: XtAddInput() steals CPU Message-ID: <9102181900.AA00583@spike.ora.com> Date: 18 Feb 91 14:00:19 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 42 > > |> 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.... > > Which implementation are you using? Most Xt UNIX implementations use > the select() system call, so this isnt' a problem, unless you're trying > to read from regular files, where select() doesn't work. This is such a common problem that it is described in the Frequently Asked Questions (FAQ) that appear monthly on this list and on motif-talk (Question 39 on the last copy I have). > > Note that O'Reilly tends to over generalize from one or two examples, > so their text may not apply to your system. > -- > Ken Lee In this particularly case, the behavior is as described on many systems, not just one or two (otherwise, why would it be a FAQ?). In the latest editions, the text also qualifies the comment ("On some operating systems...."). We welcome comments from readers who can provide specific comments about how certain features work on various architectures and operating systems. Ken, can you provide a little more information about your counter-examples? ************************************************************* Adrian Nye (314) 531-1231 O'Reilly & Associates, Inc., Publishers of Nutshell Handbooks 90 Sherman Street, Cambridge, MA 02140 UUCP: uunet!ora!adrian ARPA: adrian@ora.com *************************************************************