Xref: utzoo comp.unix.programmer:815 comp.windows.x:31381 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!usc!sdd.hp.com!spool2.mu.edu!uunet!mcsun!hp4nl!let.rug.nl!bert From: bert@let.rug.nl (Bert Bos) Newsgroups: comp.unix.programmer,comp.windows.x Subject: Asynchronous input from several sources: how? Keywords: X Windows events, pipe, non-blocking Message-ID: <1487@gufalet.let.rug.nl> Date: 10 Jan 91 15:39:27 GMT Followup-To: poster Organization: Faculty of Arts, Groningen University, The Netherlands Lines: 19 I'm writing a program using X Windows that also needs to read input coming in over a pipe. The incoming data is displayed in a window, but while that happens, the program has to check for events (expose, button press, etc.) My current solution is to simply poll both sources of input (using non-blocking read and XPending) but this seems rather wasteful of processor time. Is there a way to wait for something to arrive on either channel? Would such a solution indeed be more efficient? (I'm using X11R3, no widgets, and HP-UX; programming is done in C) Please e-mail. -- "Always remember, however, that there's Bert Bos (bert@let.rug.nl) usually a simpler and better way to do Alfa-informatica something than the first way that pops RijksUniversiteit Groningen into your head." (D.E. Knuth, TeXbook) Groningen, The Netherlands