Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!hybrid!torag!utdoe!generic!pnet91!ericmcg From: ericmcg@pnet91.cts.com (Eric Mcgillicuddy) Newsgroups: comp.sys.apple2 Subject: Re: what to do with the Text Tools (multitasking tools) Message-ID: <767@generic.UUCP> Date: 25 May 91 06:45:02 GMT Sender: root@generic.UUCP Organization: People-Net [pnet91], Etobicoke, ON Lines: 27 >B makes a call to the Console Driver. All other processes stop, because >we have to turn off task switching during GS/OS calls (becuase we don't know >which calls are reentrant, and which are not- I suspect none of them are). That is not neccessary, as long as you can prevent other processes from accessing the toolbox or making GS/OS calls while they are in use. As far as I can tell 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). I don't care much stack space is taken since it would be grabbed if this was a single task anyhow, the problem is with the Work area memory assigned during boot (or tool initialization). Thsi is global to all processes accessing a given Toolset and can not be counted to be in any given state if more than one access is made to it simultaneously. I believe 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 (it should be possible to determine the process state prior to the call from the parameters on the stack and thus reset the state to just prior to making the call, this allows the process to run again at a later date and the dispatcher will again check the flag. A strictly fair queue can be established if one wishes to be fancy to insure that no process is ever locked out for more than one tool call, an alternate Call Pending flag that is test if the Toolbox busy flag is clear). This should allow both pre-emptive and co-operative multitasking to be used. UUCP: bkj386!pnet91!ericmcg INET: ericmcg@pnet91.cts.com