Multitasking Systems: Difference between revisions

Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
No edit summary
Line 55: Line 55:
</pre>
</pre>


Sketch on a papersheet the memory of the machine, with the pid_table, the two stacks , the current_pid variable, and then go. You should be able to emulate the behaviour of that machine if --say-- you have a interrupt every 10+some_number_you_get_by_rolling_a_dice machine instructions.
Sketch on a papersheet the memory of the machine, with the pid_table, the two stacks , the current_pid variable, and then go. You should be able to emulate the behavior of that machine if --say-- you have a interrupt every 10+some_number_you_get_by_rolling_a_dice machine instructions.


And you'll see it can continue working on program 1 after it has been interrupted for 10+ instructions by program 2.
And you'll see it can continue working on program 1 after it has been interrupted for 10+ instructions by program 2.
Line 61: Line 61:
Of course "10+dice" is not enough to get decent performances. On modern systems, your timeslice is usually of a few milliseconds, which makes millions of instructions! Moreover, you don't always switch when the timer arise (because you might want the system clock more accurate than the switching rate) and you can switch on other events (e.g. because a program needs to wait for something or because something important like the end of a disk request happened).
Of course "10+dice" is not enough to get decent performances. On modern systems, your timeslice is usually of a few milliseconds, which makes millions of instructions! Moreover, you don't always switch when the timer arise (because you might want the system clock more accurate than the switching rate) and you can switch on other events (e.g. because a program needs to wait for something or because something important like the end of a disk request happened).


==Related Articles==
==See Also==
===Articles===
*[[Context Switching]]
*[[Monotasking Systems]]
*[[Monotasking Systems]]
*[[wikipedia:Computer_multitasking|Wikipedia - Computer Multitasking]]
*[[wikipedia:Computer_multitasking|Wikipedia - Computer Multitasking]]


==Related Threads==
==Threads==
*[[Topic:6332|Designing a kernel to be preemptible]]
*[[Topic:9669|Designing a kernel to be preemptible]]
*[[Topic:812|Making a fully preemptible kernel]]
*[[Topic:812|Making a fully preemptible kernel]]