home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x
- Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!csn!teal!raney
- From: raney@teal.csn.org (Scott Raney)
- Subject: Re: Implementing XNextEvent timeout
- Message-ID: <raney.713761414@teal>
- Sender: news@csn.org (news)
- Nntp-Posting-Host: teal.csn.org
- Organization: Colorado SuperNet, Inc.
- References: <1992Aug12.082152.3277@g2syd.genasys.com.au>
- Date: Fri, 14 Aug 1992 03:03:34 GMT
- Lines: 30
-
- andrewc@g2syd.genasys.com.au (Andrew Congdon) writes:
-
- >Sorry if this is an FAQ but..
- >Has anyone had any experience of implementing a timeout in Xlib? I'm
- >trying to interrupt XNextEvent with an alarm but it resumes read(2)
- >after the handler is executed.
-
- >How does Xt implement timeouts?
-
- UTSL!
-
- Xt uses the select() system call. This call has a parameter for the
- maximum time to wait before returning (you also pass it the X server
- connection, which the Xlib macro ConnectionNumber(Display) returns).
- Use it with the gettimeofday() call to measure short intervals. Not
- quite real-time UNIX, but it works pretty well. You can get reliable
- returns down to about 20ms on a lightly loaded machine.
-
- >Thanks in advance.
-
- >--
- >Andrew Congdon | Genasys II Pty Ltd
- > | 13th Level, 33 Berry St, North Sydney, NSW, Australia
- > | Phone: +61-2-954-0022 (-9930 FAX)
- > | Internet: andrewc@g2syd.genasys.com.au
- --
- ***********************************************************************
- * Scott Raney 303-447-3936 Remember: the better you look, *
- * raney@metacard.com the more you'll see -- Lidia *
- ***********************************************************************
-