Embedded Systems
Embedded Systems
MODULE 4
MULTITASKING
MULTIPROGRAMMING -
MULTIPROCESSING
MULTIPROCESSING
1. Execute multiple processes simultaneously.
2. Multiple processes = multiple processors
3. Multiprocessing in Multiprocessor s/ms
4. S/M s with this ability possesses multiple
processors (CPUs) that execute multiple
processes simultaneously.
MULTIPROGRAMMING
1. Store multiple programs in the memory at a
time
2. Execute multiple programs simultaneously
3. Applicable for multiprocessor and uniprocessor
systems
4. In multiprocessor multiprogramming ====
multiprocessing
5. In uniprocessor multiprogramming ====
multitasking.
WHY MULTIPROGRAMMING?
In the early days of computing,CPU timewas expensive, andperipheralswere very
slow. When the computer ran a program that needed access to a peripheral, the
central processing unit (CPU) would have to stop executing program instructions
while the peripheral processed the data. This was deemed very inefficient. [
citation needed]
The first computer using a multiprogramming system was the BritishLeo IIIowned
byJ. Lyons and Co.Several different programs in batch were loaded in the
computer memory, and the first one began to run. When the first program reached
an instruction waiting for a peripheral, the context of this program was stored
away, and the second program in memory was given a chance to run. The process
continued until all programs finished running. [citation needed]
The use of multiprogramming was enhanced by the arrival ofvirtual memoryand
virtual machinetechnology, which enabled individual programs to make use of
memory and operating system resources as if other concurrently running programs
were, for all practical purposes, non-existent and invisible to them. [citation needed]
Multiprogramming doesn't give any guarantee that a program will run in a timely
manner. Indeed, the very first program may very well run for hours without needing
access to a peripheral. As there were no users waiting at an interactive terminal,
this was no problem: users handed in a deck of punched cards to an operator, and
came back a few hours later for printed results. Multiprogramming greatly reduced
wait times when multiple batches were being processed
MULTITASKING
1. Multitasking is pseudo parallelism
2. It creates an illusion of parallel execution of multiple
programs.
3. multitaskingis a concept of performing multipletasks
over a certain period of time by executing them
concurrently.
4. New tasks start and interrupt already started ones
before they have reached completion, instead of
executing the tasks sequentially so each started task
needs to reach its end before a new one is started. As
a result, a computer executes segments of multiple
tasks in an interleaved manner, while the tasks share
common processing resources such ascentral
processing units(CPUs) andmain memory.
Multitasking doesnotnecessarily mean that
multiple tasks are executing at exactly the
same time.
multitasking does not imply
parallel execution, but it does mean that
more than one task can be part-way through
execution at the same time, and that more
than one task is advancing over a given
period of time.
MULTITASKING IN
UNIPROCESSOR S/MS
Uniprocessor s/ms :
1. Multiple tasks cannot be executed
simultaneously
2. However it can attain some deg of pseudo
parallelism for simultaneous multiple task
execution using multitasking
3. The technique is to switch execution among
different processes simultaneously.
4. The OS holds multiple processes in memory
and switch the CPU from executing one
processor to another processor.
In the case of a computer with a single CPU,
only one task is said to be running at any point
in time, meaning that the CPU is actively
executing instructions for that task.
Multitasking solves the problem by scheduling
which task may be the one running at any
given time, and when another waiting task
gets a turn.
The act of reassigning a CPU from one task to
another one is called acontext switch; the
illusion of parallelism is achieved when
context switches occur frequently enough.
MULTITASKING IN
MULTIPROCESSOR S/MS
Onmultiprocessorormulticorecomputers,
which have multiple CPUs/cores so more
than one task can be executed at once
(physically, one per CPU or core),
multitasking allows many more tasks to be
run than there are CPUs.
HOW MULTITASKING ?
Operating systems may adopt one of many different scheduling
strategies, which generally fall into the following categories: [
citation needed]
REFER PAPER