Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ncar!husc6!husc4!moghe From: moghe@husc4.HARVARD.EDU (moghe m) Newsgroups: comp.windows.x Subject: Awaiting _non_ X events, was Re : XtAddTimeOut() .... Message-ID: <4039@husc6.harvard.edu> Date: 30 Aug 90 00:59:07 GMT References: <9008231943.AA01202@crc.skl.dnd.ca> <141292@sun.Eng.Sun.COM> Sender: news@husc6.harvard.edu Reply-To: moghe@husc4.UUCP Organization: Harvard University Science Center Cambridge, MA Lines: 41 In article <141292@sun.Eng.Sun.COM> argv@turnpike.Eng.Sun.COM (Dan Heller) writes: >In article <9008231943.AA01202@crc.skl.dnd.ca> jgraham@CRC.SKL.DND.CA (Jay Graham) writes: >> We are developing an application on 386/ix and will need time >> interrupts in the 10s of milleseconds range, however when using >> XtAddTimeOut() with a 10ms .... >> >> > >Don't try to develop something similar -- this is the best resolution >you're going to get, all things considered. XtAddTimeOut() is closely >tied to the select() system call. this is the ultimate system call that >returns when either > 1) there is data on the X connection to read > 2) select() times out first...... > > >dan >---------------------------------------------------- >O'Reilly && Associates argv@sun.com / argv@ora.com >Opinions expressed reflect those of the author only. In the bad-old-days-before-X one would use this select() in the main loop to wait on Keys, Mouse, Timeout or whatever other events on any file descriptors were of interest. But now, if you have an X application which also needs to handle events other than X events, how does one do it? Lets say you want the X application to await on a message on a socket in addition to handling events from the X-server. Lets say that the message on the socket updates the screen. Now one could use an auxiliary process to collect the message and XsendEvent() it to the X-applicaion via the X-server, but that seems such a round-about way to go. Is there a more direct way to await _NON_ X events in the X main loop? If so, are there any traps? Email comments accepted. moghe@husc4