Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jarthur!spectre.ccsf.caltech.edu!tybalt.caltech.edu!toddpw From: toddpw@tybalt.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: apple // and multitasking, perfect together! (!!!!!!!!!!) Message-ID: <1990Mar8.015419.4197@spectre.ccsf.caltech.edu> Date: 8 Mar 90 01:54:19 GMT References: <14298@phoenix.Princeton.EDU> <17861@boulder.Colorado.EDU> <7377@latcs1.oz.au> Sender: news@spectre.ccsf.caltech.edu Organization: California Institute of Technology Lines: 29 stephens@latcs1.oz.au (Philip J Stephens) writes: > For even more simplicity, the compiler really only needs to insert BRK >instructions after every _atomic_ statement (not compound ones) of a high >level language. This ought to provide reasonable response time, and will >minimize the amount of context saving that is needed to switch processes. Excellent idea. I was wondering if the BRK opcodes could be defined such that (say) $80-FF were reserved for O/S functions, and 0-$7F were defined to point into a 'process subroutine table' or something like that which would be generated by the compiler and would be modified stack-style for each block of code that uses its own. In fact, the compiler could just have each function big enough to need the table call the O/S to save & restore the subroutine table pointer. This allows you to use the BRK/IRQ vector and provides excellent task-switching opportunities, plus it is inherently relocatable. It does bear the cost of the subrountine calls but any program large enough to need it will take long enough to make the call overhead negligable. One exception to this would be heavy recursion and the only efficient solution I can think of is simple tagged relocation for JSRs and JMPs. > So there you have it! One day ago, I was complaining that it would be >too difficult to implement; today someone comes up with a brainstorm - and >now anything is possible :-) :-) :-) Watch out, sooner or later we'll have to put our coding skills where our mouths are.. :) Todd Whitesel toddpw @ tybalt.caltech.edu