Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ucbvax!ji.Berkeley.EDU!shs From: shs@ji.Berkeley.EDU.UUCP Newsgroups: comp.sys.amiga Subject: Re: Intuition's "dont mess with these" fields... Message-ID: <21519@ucbvax.BERKELEY.EDU> Date: Fri, 30-Oct-87 01:21:11 EST Article-I.D.: ucbvax.21519 Posted: Fri Oct 30 01:21:11 1987 Date-Received: Sun, 1-Nov-87 06:22:36 EST References: <1961@amiga.amiga.UUCP> <1825@cadovax.UUCP> <21469@ucbvax.BERKELEY.EDU> <1830@cadovax.UUCP> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: shs@ji.Berkeley.EDU.UUCP (Steve Schoettler) Organization: University of California, Berkeley Lines: 41 Keywords: Intuition lockibase forbid Summary: PLEASE dont FORBID! In article <1830@cadovax.UUCP> keithd@cadovax.UUCP (Keith Doyle) writes: >> key=LockIBase(0L); >> /* Do funny stuff here... but not much of it... be QUICK! */ >> UnlockIBase(key); > >Sounds reasonable. Is this any better/worse/different than doing a >Forbid()/Permit() or an Enable()/Disable() ? YES!!! The main difference is that LockIBase allows other tasks to run (except ones that want to LockIBase also). Forbid() prevents other tasks from running. This may be necessary for some programs, but should be used as little as possible. In all cases if LockIBase() is sufficient, use it over Forbid (it should be sufficient for any Intuition meddling). Disable() is the worst of the three and prevents other interrupts from occurring. This means trackdisk, video, timers, etc. For passing data (semaphores) between user processes, Forbid() is sufficient, unless you think some interrupt handler is going to mess with your data. *** I cannot stress enough a frugal use of Forbid()/Permit(). Many programmers don't think too hard about this and just stick it in for safety. If you are running a multiple processor configuration, this means that all processors must stop. I'm not kidding here. Think about tasks on a stock Amiga that you will be halting. Then think ahead some more. In the not too far future, there will be multiple processors running in Amiga cards, and the only way to deal with a Forbid() on one is to stop them all. Although necessary for some applications, this is very painful. Please be a good citizen and limit Forbid and Disable as much as possible. Steve Schoettler