Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!mips!apple!dlyons From: dlyons@Apple.COM (David A Lyons) Newsgroups: comp.sys.apple2 Subject: Re: what to do with the Text Tools (multitasking tools) Message-ID: <53393@apple.Apple.COM> Date: 28 May 91 09:57:39 GMT References: <767@generic.UUCP> Organization: Apple Computer Inc., Cupertino, CA Lines: 37 In article <767@generic.UUCP> ericmcg@pnet91.cts.com (Eric Mcgillicuddy) writes: >[toolbox] Calls do not use a processes zero page space for anything, they steal >a bit of stack space, usually less than $20 bytes (Memory Manager is the only >one I have seen in depth though). Correct, tool calls frequently use space on the caller's stack (sometimes much more than 32 bytes...more like half a K for Standard File, since it calls the Dialog Manager, and the Dialog Manager uses a whole page). But the caller's direct page is off-limits, and the D register could actually point into ROM or softswitches, or overlap the stack in some inconvenient way. (That's why, in general, it is *not* okay to "borrow" direct-page locations, preserving and restoring them, if you don't know where D points! Very unsafe!) >[...] >there is a flag that tells whether the tools are in use, something like the >"prodos busy" flag I assume, if not then a small patch to the tool dispatcher >and a global flag could easily be installed. If the flag is set, then the >called process is immediately suspended There is a system BUSY flag managed by calling INCBUSY and DECBUSY, and a lot of tool sets use it. Hopefully it is used everywhere it should be, but I suspect there are a few non-reentrant calls that fail to use it, and such problems probably won't show up until somebody stress-tests it by writing something that depends on it. Note that the BUSY flag is frequently nonzero for long periods of time. For example, while a ChooseFont or Standard File dialog is up, or when you're waiting for a key inside ReadChar. -- David A. Lyons, Apple Computer, Inc. | DAL Systems Apple II System Software Engineer | P.O. Box 875 America Online: Dave Lyons | Cupertino, CA 95015-0875 GEnie:DAVE.LYONS CompuServe:72177,3233 Internet:dlyons@apple.com My opinions are my own, not Apple's.