Re: TIB: Multitasking


[Prev][Next][Index][Thread]

Re: TIB: Multitasking




Jody wrote:
> 
> Rene Kragh Pedersen wrote:
[...]

> > You can't really make a general "save" mechanism like that without
> > slowing your calc severaly.
> > But you could make save function in the game. That would be easy.
> >
> > --
> >           Rene Kragh Pedersen
> > ------------------------------------------------------------------
> > Apparently my clothes are defective.
> >  - Dilbert.
> 
> That's not entirely true. On the 83 most of the variables are made up
> of the letters A->Z and @. It is a small loop that can save all of
> those variables into a special list. Another loop to get them back.
> Would be much harder to try to save all the other possible special
> variables (statistic variables and all that). I don't think that this
> is the same type of situation on the 85, though.

Well, the problem, as I see it, is that you have no idea of knowing
which variables your currently running program are using. That means
you'll have to back up all possibilities. This will be both memory and
time consuming. It _IS_ possible to do it, and when you're finished I'd
like to see you start program #3 while #1 and #2 are still in interrupt
mode (can you spell 'costly recursivity'? :-)

One possible way would be for each 'interrupt-compatible' program to
have a data file where the names of all used variables are.
This data file must be done by hand, only once, but will _also_ take up
memory. If you want to support multiple interrupts you'll have to have
data files that keep track of all the renamed/backup'ed variables'
names. Again, memory consuming.
Finally, this program - given the renaming of variables - will severely
mess up your calculator if terminated aprubtly.
Of course, all you have to do is retrieve the data files that say which
varibles have been renamed to what. This would make an excellent
sub-program. When your interrupt program stops, it will run the sub,
thus restoring the variables properly. If terminated incorrectly, there
is a good deal of chance that you can recover the losses yourself by
running the sub-program independently of the other.

It's a cool idea with few significant limitations, namely high memory
usage and a tricky implementation.
But of course...with a TI-92+ ... :->

-- 
          Rene Kragh Pedersen
------------------------------------------------------------------
Apparently my clothes are defective.
 - Dilbert.


Follow-Ups: References: