Welcome, Guest. Please login or register.

Author Topic: multitasking  (Read 1949 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: multitasking
« on: July 16, 2013, 10:20:56 AM »
AmigaOS multitasking is nice and simple. You have an interrupt that fires every 4/50th of a second, every time that interrupt occurs, the exec scheduler looks at the "ready list" (a list of tasks that are ready to run), if any of those tasks have a priority that is equal to or higher than the currently running task, then that task replaces the currently running task. This process is repeated in a "round robin" style approach so that all tasks at te same priority will execute, one after another.

If a task gives up it's execution slot, by waiting for an external event or system, then the scheduler will go back to the ready list and execute the next ready task!

Simple :)

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: multitasking
« Reply #1 on: July 16, 2013, 02:29:04 PM »
Quote from: stefcep2;740927
So Executive would change this round robin process?
Executive just monitors the CPU usage of each task, and then drops its priority if it is using to much time. Locking the offending task out for a while, giving other task a chance to run.

One of the flaws with the Amiga multitasking, is that if a task doesn't give up the CPU, any task with a lower priority will be locked out.

-edit- it's not really a flaw with the Amiga, but it is a idealistic system, that assumes all task will run at priority 0, only urgent short running tasks will be put above that and only very non critical tasks will be put below that. It works well 99% of the time, but there is always one task that will screw it up for everyone else ;)
« Last Edit: July 16, 2013, 02:33:18 PM by bloodline »
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: multitasking
« Reply #2 on: July 16, 2013, 09:15:12 PM »
Quote from: Thorham;740941
Any computer can do it with the right os, including the C64 and similar machines ;)
The lack of a supervisor stack on the 6502 makes it quite a bit more difficult :(

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show all replies
    • http://www.troubled-mind.com
Re: multitasking
« Reply #3 on: July 16, 2013, 10:04:33 PM »
Quote from: commodorejohn;740972
True. Then again, a little memory-mapping hardware (which the 128 includes right off the bat) can solve that issue.
Hmmm, having writing a few multitasking systems for microcontrolers, I'd have to say that the 6502 and the Z80 to both be a real pain to do proper context switches... It was easier to write a time slicing interpreter instead.