CompuServe Thread

Forum unknown · Programming

Multitasking

3 messages in this thread
#32589From: Darrel SchneiderSep 9, 1986 3:27 AM
I was wondering if anyone following this multitasking thread knows how much overhead is involved in the Exec task switching. By this I mean how much time does it take for the system to put a task to sleep and wake another up? I know that at least all the registers must be saved but I'm sure alot more than this is involved. I've seen a couple of people say that the most time a task can remain active is 1/15 of a second. Is this true? If it is and the speed of the 68000 is 7.16 then does this mean that a task can perform 477,333 cycles if not preempted by a higher priority task? This seems like an awful lot and I was wondering if my calculations where fouled up somewhere. Also has anyone figured out how much smaller and faster a task is compared to a process? -Darrel
#32611From: Dan MooreSep 9, 1986 12:19 PM
From what I recall there isn't much overhead other than saving and reloading the 68K registers. The balance of the rest of the task switch is figuring out which task/process gets run next. If a task doesn't do a wait() it will run for up to 4 frames (1/15 second) with out interruption (ignoring interrupts such as vblank). If it does a wait() it will run for less. (That is why it is important to use wait(), it increases the overall performance of the system.) Dan
#32611From: Dan MooreSep 9, 1986 12:19 PM
From what I recall there isn't much overhead other than saving and reloading the 68K registers. The balance of the rest of the task switch is figuring out which task/process gets run next. If a task doesn't do a wait() it will run for up to 4 frames (1/15 second) with out interruption (ignoring interrupts such as vblank). If it does a wait() it will run for less. (That is why it is important to use wait(), it increases the overall performance of the system.) Dan