Welcome, Guest. Please login or register.

Author Topic: multitasking  (Read 1935 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline IggyTopic starter

  • Hero Member
  • *****
  • Join Date: Aug 2009
  • Posts: 5348
    • Show only replies by Iggy
multitasking
« on: July 16, 2013, 03:20:55 AM »
Can anyone explain to me how AmigaOS handles time slicing, process and priority control, and other aspects inherent to multitasking?

I know how other 68K OS' handle these tasks, the the Amiga is a black box to me in this respect.

And I can't find any documentation covering the subject.
"Not making any hard and fast rules means that the moderators can use their good judgment in moderation, and we think the results speak for themselves." - Amiga.org, terms of service

"You, got to stem the evil tide, and keep it on the the inside" - Rogers Waters

"God was never on your side" - Lemmy

Amiga! "Our appeal has become more selective"
 

Offline ElPolloDiabl

  • Hero Member
  • *****
  • Join Date: May 2009
  • Posts: 1702
    • Show only replies by ElPolloDiabl
Re: multitasking
« Reply #1 on: July 16, 2013, 03:55:10 AM »
Some of the books would have explained it, I cannot remember which one's however.

I found this:
http://wiki.amigaos.net/index.php/Introduction_to_Exec
Go Go Gadget Signature!
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: multitasking
« Reply #2 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 Lurch

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Dec 2003
  • Posts: 1716
    • Show only replies by Lurch
Re: multitasking
« Reply #3 on: July 16, 2013, 10:43:02 AM »
To me the Amiga was the first true multitasking computer. Preemptive multitasking is what it uses from memory.

http://en.wikipedia.org/wiki/Preemption_%28computing%29
-=[LurcH]=-
A500 Plus Black 030@40MHz 128MB | A1200T 060@80MHz 320MB | Pegasos II G4@1GHz 1GB  | Amiga Future Sub
 

Offline psxphill

Re: multitasking
« Reply #4 on: July 16, 2013, 11:13:52 AM »
Quote from: Lurch;740915
To me the Amiga was the first true multitasking computer. Preemptive multitasking is what it uses from memory.
 
http://en.wikipedia.org/wiki/Preemption_%28computing%29

First pre-emptive multitasking desktop computer, even Windows and MacOS didn't have it. However many mainframe and workstations did.
 

Offline stefcep2

  • Hero Member
  • *****
  • Join Date: Sep 2007
  • Posts: 1467
    • Show only replies by stefcep2
Re: multitasking
« Reply #5 on: July 16, 2013, 02:19:52 PM »
Quote from: bloodline;740914
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 :)


So Executive would change this round robin process?
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: multitasking
« Reply #6 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 Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: multitasking
« Reply #7 on: July 16, 2013, 03:59:38 PM »
Quote from: Lurch;740915
To me the Amiga was the first true multitasking computer. Preemptive multitasking is what it uses from memory.

Any computer can do it with the right os, including the C64 and similar machines ;)
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: multitasking
« Reply #8 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 Lurch

  • Lifetime Member
  • Hero Member
  • *****
  • Join Date: Dec 2003
  • Posts: 1716
    • Show only replies by Lurch
Re: multitasking
« Reply #9 on: July 16, 2013, 09:27:38 PM »
Quote from: psxphill;740917
First pre-emptive multitasking desktop computer, even Windows and MacOS didn't have it. However many mainframe and workstations did.


Yeah, I should have worded it differently :-)

Quote from: Thorham;740941
Any computer can do it with the right os, including the C64 and similar machines ;)


Not sure I would want to try multitasking on a C64 :-) I did have a Commodore 486 for awhile which I used as BBS system where I had to multitask under DOS.

It was possible used DesQView and QEMM and could have three BBS nodes running, although I used just two.

One was for local logon and the other was for live.

Was really robust compared to Windows 3.11 :-)
-=[LurcH]=-
A500 Plus Black 030@40MHz 128MB | A1200T 060@80MHz 320MB | Pegasos II G4@1GHz 1GB  | Amiga Future Sub
 

Offline commodorejohn

  • Hero Member
  • *****
  • Join Date: Mar 2010
  • Posts: 3165
    • Show only replies by commodorejohn
    • http://www.commodorejohn.com
Re: multitasking
« Reply #10 on: July 16, 2013, 09:28:49 PM »
Quote from: bloodline;740968
The lack of a supervisor stack on the 6502 makes it quite a bit more difficult :(
True. Then again, a little memory-mapping hardware (which the 128 includes right off the bat) can solve that issue.
Computers: Amiga 1200, DEC VAXStation 4000/60, DEC MicroPDP-11/73
Synthesizers: Roland JX-10/MT-32/D-10, Oberheim Matrix-6, Yamaha DX7/FB-01, Korg MS-20 Mini, Ensoniq Mirage/SQ-80, Sequential Circuits Prophet-600, Hohner String Performer

"\'Legacy code\' often differs from its suggested alternative by actually working and scaling." - Bjarne Stroustrup
 

Offline Thorham

  • Hero Member
  • *****
  • Join Date: Oct 2009
  • Posts: 1150
    • Show only replies by Thorham
Re: multitasking
« Reply #11 on: July 16, 2013, 09:50:34 PM »
Quote from: bloodline;740968
The lack of a supervisor stack on the 6502 makes it quite a bit more difficult :(
What makes it even harder is the lack of a movable stack, which I missed :(
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: multitasking
« Reply #12 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.