home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / 15232 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.6 KB  |  43 lines

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