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