home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / amiga / programm / 11521 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.3 KB

  1. Path: sparky!uunet!sun-barr!decwrl!csus.edu!netcomsv!terapin!paulk
  2. From: paulk@terapin.com (Paul Kienitz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: LockIBase race condition
  5. References: <PfKnr*hX0@chsdip.wisdom.bubble.org>
  6. Message-ID: <paulk.0uvk@terapin.com>
  7. Date: 22 Jul 92 20:35:40 PST
  8. Organization: BBS
  9. Lines: 24
  10.  
  11. > I've written a small ScreenSwitch commodity to activate the first
  12. > window on the next (or previous) screen.  This lets you switch
  13. > screens without "clicking in", and avoids the annoying overhead of
  14. > "AutoPoint"-type commodities.
  15.  
  16. I've found that the overhead of an autopoint routine can be kept
  17. to a fraction of what the input.device uses anyway (near as I can
  18. measure, which is not very well) by making it avoid checking which
  19. window the mouse is over more often than ten times a second, rather
  20. than every time it moves.  My modified DMouse (DRat) does this.
  21.  
  22. >         UnlockIBase(lock);
  23. >         ScreenToFront(); or ScreenToBack(); // <-- race
  24. > Now it's understandably unlikely that enough context switches are
  25. > going to occur between the UnlockIBase() and the ScreenToFoo() call
  26. > which allow the ScreenToFoo()'d screen to close. ...but it is
  27. > _possible_.
  28. > I could Forbid()/Permit() the whole thing, but that seems generally
  29. > unfriendly.
  30.  
  31. But it's what you gotta do, I bet.
  32.