Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!ukma!tut.cis.ohio-state.edu!unmvax!ncar!ames!oliveb!intelca!mipos3!omepd!davidl From: davidl@intelob.biin.com (David Levine) Newsgroups: comp.windows.x Subject: Re: XSelectNextEvent() Message-ID: Date: 8 Mar 89 22:09:34 GMT References: <134@mirsa.inria.fr> Sender: news@omepd.UUCP Organization: BiiN Corporation, Hillsboro, Oregon Lines: 27 In-reply-to: daniel@mirsa.inria.fr's message of 27 Feb 89 13:23:14 GMT I'm following-up rather than replying via mail because I count the chances of a message getting through to France as about nil. > I want to wait for X events from more than one X server. > (it's for a communication program named xtalk, which act > basically like the unix-talk but with the X protocol and > windows/mouse convenience: independent window, drawing facility, > talk with several persons...) I'd say that this application is a good candidate for multi-processing. You have two asynchronous event sources. If you try to deal with them both in one (synchronous) process, you will either spend a lot of time in pointless looping (which is expensive of CPU time) or block on one event source while ignoring input on the other (which increases response time). I'd suggest you fork() two processes, one to watch each display, which communicate with each other via pipes or shared memory. This solution has nothing to do with X, really, but it's the best one I can think of offhand... David D. Levine BBBBBBBBB IIII IIII NNN NNNN TM Senior Technical Writer BBBB BBBB iiii iiii NNNN NNNN BBBBBBBBB IIII IIII NNNNNNNNN UUCP: ...[!uunet]!tektronix!biin!davidl BBBB BBBB IIII IIII NNNN NNNN MX-Internet: BBBBBBBBB IIII IIII NNNN NNN ARPA: <@iwarp.intel.com:davidl@intelob.intel.com>