0% found this document useful (0 votes)
3 views32 pages

1. Introduction, Multiple Tasks and Multiple Processes

The document discusses processes and operating systems, focusing on concepts such as multitasking, multiprogramming, and multithreading. It highlights the importance of managing multiple tasks and processes in embedded systems, including timing requirements and scheduling policies. Additionally, it covers specific applications like automotive engine control and the challenges of implementing multirate systems.

Uploaded by

rsubasre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views32 pages

1. Introduction, Multiple Tasks and Multiple Processes

The document discusses processes and operating systems, focusing on concepts such as multitasking, multiprogramming, and multithreading. It highlights the importance of managing multiple tasks and processes in embedded systems, including timing requirements and scheduling policies. Additionally, it covers specific applications like automotive engine control and the challenges of implementing multirate systems.

Uploaded by

rsubasre
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 32

UNIT V

PROCESSES AND OPERATING


SYSTEMS
Syllabus
Introduction – Multiple tasks and multiple processes –
Multirate systems- Preemptive real-time operating
systems - Priority based scheduling - Interprocess
communication mechanisms – Evaluating operating
system performance - power optimization strategies
for processes – Example Real time operating systems-
POSIX-Windows CE. - Distributed embedded
systems – MPSoCs and shared memory
multiprocessors. – Design Example - Audio player,
Engine control unit – Video accelerator.
Introduction
 Simple applications can be programmed on a
microprocessor by writing a single piece of code many
applications are sophisticated enough that writing one
large program does not suffice.
 When multiple operations must be performed at widely
varying times a single program can easily become too
complex and unwieldy.
 The result is spaghetti code that is too difficult to verify
for either performance or functionality.
 The process cleanly defines the state of an executing
program, while the OS provides the mechanism for
switching execution between the processes.
Multiple tasks and multiple processes

Process

Multiprogramming

Multitasking

Multiprocessing

Multithreading
Process
A single execution of a program is called as
Process.
If we run the same program two different times, we
have created two different processes.
Each process has its own state that includes not
only its registers but all of its memory.
In some OSs, the memory management unit is used
to keep each process in a separate address space.
In others, particularly lightweight RTOSs, the
processes run in the same address space.
Processes that share the same address space are
often called threads
Multiprogramming
Multiprogramming is also the ability of an
operating system to execute more than one
program on a single processor machine.
More than one task/program/job/process can
reside into the main memory at one point of
time.
A computer running excel and firefox browser
simultaneously is an example of
multiprogramming.
Multitasking
Multitasking is the ability of an operating
system to execute more than one task
simultaneously on a single processor machine.
In reality no two tasks on a single processor
machine can be executed at the same time.
Actually CPU switches from one task to the
next task so quickly that appears as if all the
tasks are executing at the same time.
Multitasking System
Multiprocessing
Multiprocessing is the ability of an operating
system to execute more than one process
simultaneously on a multi processor machine.
In this, a computer uses more than one CPU at
a time.
Multithread
Threads are the light wait processes which are independent
part of a process or program
Processes that share the same address space are often
called threads
Multithread
Multithreading is the ability of an operating system to
execute the different parts of a program called threads
at the same time.(ex. spelling check ,grammar checking
in microsoft word )
Threads are the light wait processes which are
independent part of a process or program.
In multithreading system, more than one threads are
executed parallel on a single CPU.
Multiple tasks and multiple
processes
 Many embedded computing systems do more
than one thing that is the environment can
cause mode changes that in turn cause the
embedded system to behave quite differently.
 These different tasks are part of the system’s
functionality but that application-level
organization of functionality is often reflected
in the structure of the program as well.
 A process is a single execution of a program. If
we run the same program two different times we
have created two different processes.
 Each process has its own state that includes not
only its registers but all of its memory.
 In some OSs, the memory management unit is
used to keep each process in a separate address
space. In others, particularly lightweight RTOSs,
the processes run in the same address space.
 Processes that share the same address space are
often called threads.
To understand why the application can be divided into tasks let us consider the
example.

This device is connected to serial ports on both ends. The input to the box is
an uncompressed stream of bytes. The box emits a compressed string of bits
on the output serial line, based on a predefined compression table. Such a box
may be used, for example, to compress data being sent to a modem.
Variable data rates:
The variable data rates term used in
telecommunication and computation related to the bit rate
used in sound or video encoding. It allows a higher bit rate to
be located to the more complex segments of media files and
less space is allocated to less complex segments.
Advantages:
• It produces a better quality to space ratio
• It used more flexible to encode the sound or video data more
accurately.
Disadvantages:
• It may take more time to encode, as the process in more
complex.
• Some hardware may not compatible with variable data rates.
Asynchronous input:
 The text compression box provides a simple example
of rate control problems. A control panel on a
compression machine provides an example of a
different type of rate control problem, known as
asynchronous input.

 Sampling the button’s state too slowly can cause


the machine to miss a button depression.

 Sampling is too frequently and duplicating a data


value can cause the machine to incorrectly
Multirate Systems
 Implementing code that satisfies timing
requirements is even more complex when
multiple rates of computation must be handled.
 In multirate systems, certain operation must be
executed periodically and each operation is
executed at its own rate
 Ex, Automobile engines, Printers, Cellphones
Automotive engine control:
• The simple example to describe multirate system is
automobile engine with multirate control.
• In this controller perform only one task - timing the
firing of the spark plug which takes the place of a
mechanical distributor.
Spark plug
• The spark plug must be fired at a certain point in the
combustion cycle, to obtain better performance, Due to
this relationship between the piston’s movement and the
spark should change as a function of engine speed. Using
a microcontroller that senses the engine crankshaft
position allows the spark timing to vary with engine
speed.
• Firing the spark plug is a periodic process (but note that
the period depends on the engine’s operating speed).
(ii) Control algorithm:
• Automobile engines must meet strict requirements (mandated
by law in the United States) on both emissions and fuel
economy. On the other hand, the engines must still satisfy
customers not only in terms of performance but also in terms of
ease of starting in extreme cold and heat, low maintenance, and
so on.

(iii) Engine Controller:


• The engine controller takes a variety of inputs that determine
the state of the engine. It then controls two basic engine
parameters.
1. Spark plug
2. Fuel/air mixer
Timing Requirements on processes

Each process have several different types of


timing requirements
Timing requirements strongly influence the
type of scheduling
Scheduling policy must define the timing
requirements that it uses to determine whether a
schedule is valid
Timing Requirements on processes
Two important requirements on process:
Initiation Time:
Deadline

Initiation Time:
Process goes from waiting state to ready state

Deadline:
It specifies when a computation must be finished
Timing Requirements on processes
Timing Requirements on processes
Sequence of process with a high initiation rate

Rate Requirement: it specifies how quickly


processes must be initiated
Period: It is the time between successive
executions
Jitter:
It is the allowable variation in the completion of the task

Missing a deadline:
Variety of actions can be taken when missing a deadline
Data Dependencies among process
DAG:
A directed acyclic graph (DAG) is a directed graph that
contains no cycles
A set of processes with data dependencies is known as a
task graph
Communication among processes at
different rates
CPU usage metrics
The initiation time is the time at which a process actually
starts executing on the CPU.
The completion time is the time at which the process
finishes its work.
The simplest and most direct measure is Utilization:

Utilization is the ratio of the CPU time that is being used


for useful computations to the total available CPU time.
CPU usage metrics
 This ratio ranges between 0 and 1, with 1
meaning that all of the available CPU time is
being used for system purposes.
 The utilization is often expressed as a
percentage.
 If we measure the total execution time of all
processes over an interval of time t, then the
CPU utilization is
Process State and Scheduling
• The first job of operating system is to determine
next process to run
• The work of choosing the order of running
processes is known as scheduling
• Scheduling States
• Waiting
• Ready
• Executing
Running Periodic Process

Multiple Timers

While Loop

You might also like