Re: TIB: Re: Multitasking
[Prev][Next][Index][Thread]
Re: TIB: Re: Multitasking
Rene Kragh Pedersen wrote:
[snip]
>My point stands: You cannot do it without modifying each and every one
>of your programs.
Your right you must modify your programs to operate under the os. Largely
by changing branches into changing it set a PC. Just like the old basic
on the C64.
>Also, if you have to access every program line from a list, it will work
>at a considerably slower pace than usual.
I would say slower pace, not considerably slower. It is not that bad, try
using expr on a string (If you try Vector Man out you will see that a 700
byte list and a 200 byte program become merged in only a few seconds into
a new program). Give a priority of 10 to Tetris and a priority of say 2
to a background program. Every ten lines in Tetris executed two lines of
code are executed in the background program.
>Finally, you still can't say "Now I want to break this game to start
>this program" without having an interrupt request that lets you do it.
Your right. That is why it is cooperative multitasking. The list is
written is such a way each code segment can be executed without needing
the surrounding code to support it. Meaning it contains an entire
If...Then...Else or an entire Dialog box. All branching is easily carried
out by changing a PC (program counter).
>You can't make the program mind-read your intentions. With that in mind
>you once again have to face the problem of slowing your calc down
>further by doing frequent interrupt polls.
>
>>> However, the cold, hard fact remains that we can't do cost-efficient
>>> (pseudo-)multitasking using TI-BASIC alone.
>>
>> If you can dream it, someone can program it,
>
>Cost-efficiently? I don't think so. Time is always an important factor
>in programming. Contemplate the towers of Hanoi...
The Towers of Hanoi are rather large structures of stone in Vietnam. The
Towers of Hanoi are also a child's game were one moves a stack of seven
(varies) discs, which are each slightly smaller than the previous one.
The object is to move the tower to a different peg (out of 3) by moving
one disc at a time while never allowing larger disc on top of smaller
disc. As such a game is merely repetitive with a simple solution. However
as more disc come into play the longer it takes...
No multitasking is costless, every kind requires some overhead no matter
how minimal. The overhead is not that horrible for my multitasking os. Of
course if there is no multitasking then tetris plays faster and the
background program gets the difficult math program done sooner (if you
can stop playing tetris), but a tiny decrease in tetris's speed and while
in math class you can truthfully say that your working on your math.
I'll upload a copy of the os if anyone wants.
Michael Van Der Kolk
mikev@iserv.net
http://www.iserv.net/~mikev
Follow-Ups: