0% found this document useful (0 votes)
10 views12 pages

RTOS_1586939996

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

RTOS_1586939996

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

Task state, ISR and pipes

By
C.Mythili
A.P/EEE
Task state
• At any instant of time a task can be in one of
the following states:
• Dormant, ready, running and blocked
• When a task is first created it is in the
dormant task. When it is added to RTOS for
scheduling it is a ready task. If the input or a
resource is not available the task gets blocked.
• If no task is ready to run and all of the tasks
are blocked, the RTOS will usually run the idle
task. An idle task does nothing. The idle task
has lowest priority
Interrupt service routine(ISR)
• An interrupt service routine also known as an
interrupt handler is a callback subroutine in an
operating system or device driver.
• In a real embedded system there are two
possible interrupt
• Hardware interrupt and software interrupt
• Hardware interrupt are asynchronous interrupt
(timer, keyboard devices) which are triggered by
an electric pulse where as software interrupt are
synchronous interrupt and these are triggered by
a command or instruction.
• ISR is a small program which is executed to
develop an interface between the user and the
hardware. The CPU will execute the ISR
subroutine when it receives either a hardware or
software interrupt
Task communication
• In a multitasking system multiple tasks or
multiple processes run concurrently and each
process may not interact between
– Co-operating process
– Competing process
– Shared memory
Co-operating process

• In the co-operating interaction model one process


requires the input from other processes to complete
its execution.
• Co-operating processes exchanges information and
communicate through the following methods
– Co-operation through sharing: the co-operating
process exchange data through some shared
resources
– Co-operation through communication: No data is
shared between the processes. But they
communicate for synchronization
Competing process

• The competing processes do not share


anything among themselves but they share
the system resources
• The competing processes compete for the
system resources such as file, display devices
etc.
Shared memory

• Process share some area of the memory to


communicate among them.
Pipes
• Pipe is a selection of the shared memory used
by processes for communicating.
• A Process which creates a pipe is known as a
pipe server and a process which connects to a
pipe is known as pipe client.
• It can be unidirectional allowing information
flow in one direction or bidirectional allowing
bi directional information flow
Cont…
• A unidirectional pipe allows the process
connecting at one end of the pipe to write to
the pipe and the process connected at the
other end of the pipe to read the data,
whereas a bi directional pipe allows both
reading and writing at one end.
Cont…
• Two types of pipes
– Anonymous pipes
• These are unnamed unidirectional pipes used for data
transfer between two processes
– Named pipes
• Named pipe is named unidirectional or bidirectional
pipes used for data transfer between two processes

You might also like