Path: utzoo!attcan!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!samsung!cs.utexas.edu!rutgers!mcnc!uvaarpa!haven!decuac!bacchus.pa.dec.com!news.crl.dec.com!jg From: jg@crl.dec.com (Jim Gettys) Newsgroups: comp.windows.x Subject: Re: Waiting for Xlib events Message-ID: <1990Oct24.124108.846@crl.dec.com> Date: 24 Oct 90 12:41:08 GMT References: <3540@idunno.Princeton.EDU> Sender: news@crl.dec.com (USENET News System) Reply-To: jg@crl.dec.com (Jim Gettys) Organization: DEC Cambridge Research Lab Lines: 17 What you want to do is operating system dependent, and as X is an O.S. independent specification as much as we could make it, we don't go into how to do what you want. Select(2) is the normal way to do this on BSD derived systems; select doesn't use cycles if nothing is happening. It sounds like you are already doing things in mostly a reasonable way. Unless your program goes compute bound for long periods, this should work fine. Remember to make sure the event queue is empty before calling select again. I don't understand why you need a timeout on your select. As to full signal driven stuff, look at sigio (though you better know what you are doing if you delve into signal driven applications); again, you better have BSD "safe signals" or equivalent to be able to safely write applications that are signal driven. -- Jim Gettys Digital Equipment Corporation Cambridge Research Laboratory