home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!sgigate!odin!sgihub!zola!zuni!anchor!olson
- From: olson@anchor.esd.sgi.com (Dave Olson)
- Newsgroups: comp.sys.sgi
- Subject: Re: Mouse Interrupts
- Message-ID: <ubatc1c@zuni.esd.sgi.com>
- Date: 1 Jan 93 18:43:35 GMT
- References: <AJ3U.93Jan1103135@larch.cs.virginia.edu>
- Sender: news@zuni.esd.sgi.com (Net News)
- Organization: Silicon Graphics, Inc. Mountain View, CA
- Lines: 55
-
- By the way, 'comp' is *not* a valid distribution. If your news
- software inserted it automatically, you should get your news admin
- to update their software. I've removed the Distribution header.
-
- In <AJ3U.93Jan1103135@larch.cs.virginia.edu> aj3u@larch.cs.virginia.edu (Asim Jalis) writes:
- | 1. What mechanism does IRIX use to determine if a mouse button
- | has been pressed? I assume it uses interrupts but I am not sure.
-
- Yes, it is interrupt driven. On all current machines, the mouse
- and keyboard use the same DUART chips as the regular serial ports,
- and the same low level driver.
-
- | 2. How much time does it take between a mouse button being
- | pressed and a user program running in non-preemptable mode (i.e.
- | with a highest non-degrading priority) being informed about it if
- | it is using qtest() to constantly check the status of the event
- | queue.
-
- The question is unanswerable as asked. If you are on an MP machine,
- and dedicate a processor to your process, I think the guarantee is
- within 400 usecs. On a single processor machine, the worst case
- will probably be a few milliseconds. Typical times will probably
- be much less (on the single processor machine). Note that mouse
- events got through the X server, so the answer also partly depends
- on how much memory you have, since if parts of the server (or your
- program, for that matter) get paged out, you obviously increase
- the latency.
-
- | 3. Is there another way to find out the status of the mouse, or
- | to set up some kind of a signal that would interrupt the program
- | if the mouse button is pressed, that is presumably faster than
- | using qtest()? And there is such a way, then how much time does
- | it take between a mouse press and the program being informed
- | about it?
-
- Well, you could just queue the mouse button, and then block with
- qread(); at least you won't be doing as much polling and eating
- up CPU time. Other than that, no, their really isn't much you
- can do to reduce the time to you getting the event.
-
- |
- | 4. If the information required by questions (2) and (3) is
- | unknown then how can I determine it? I have been thinking about
- | a possible software solution, but I have not been able to come up
- | with anything satisfactory.
-
- Measure it. Put an analyzer on the mouse port, and then have your
- program write a character to one of the serial ports when it gets the
- event, and use that as your second trigger. Yes, that adds a few more
- variables, but you should be able to get a decent average, and 'worst
- case' value that way.
- --
- Let no one tell me that silence gives consent, | Dave Olson
- because whoever is silent dissents. | Silicon Graphics, Inc.
- Maria Isabel Barreno | olson@sgi.com
-