Professional Documents
Culture Documents
ppt3 - ZMP (1) .PPSX
ppt3 - ZMP (1) .PPSX
Threads:
Threads are subunits of a process which may execute simultaneously
Process may contain multiple threads. All threads of a process run in address space of
same process.
Have their own PC, stack and registers which are private and never shared
Advantages:- reduces context switching overhead, multiple control points in a
process, improves responsiveness
Process & Thread
Concept of Process & Thread
Embedded OS schedules execution of processes
Switching processes at fast rate gives feeling of multi-processing
Process Status :- ready, running, blocked, terminated, sleeping
Scheduling Algorithms
Timing parameters:
Release time : an instant the process is ready for execution
Execution (run) time : time period to complete process execution
Absolute deadline (d) : an instant by which process must finish
Slack time = (d-t) – remaining run time of process at time t
= deadline – estimated completion time (negative slack means missed
deadline)
[A] Non Preemptive Task(Process) scheduling:
(1)Round Robin (Circular Queue):
Processes are executed sequentially from ready linked list
RTOS keeps track of currently executing process. It updates linked list upon
insertion and removal of a process. New process is inserted at the end of
linked list
Circular FIFO buffer can be used to form ready list of processes
New process is inserted before the currently running one (last in circular list)
Ans:
>slack time of running process remains constant whereas for waiting process it
decreases
Resource Access Control
Global variables are often shared between ISR process and main process. As shown
sharing of variable ‘Temp’ causes race condition and leads to hazards. Without proper
locking, the code cannot be race free
Solution : (i) disable all interrupts (ii) writing sensitive part of process in critical section
(region) of memory which is protected by lock
Lock (semaphore) ensures that shared resource is acquired by only one process at a
time. It makes critical region atomic (uninterruptible). Each share resource has its own
lock (semaphore)
Semaphores
Semaphores :- acts as lock to protect critical region (piece of software where
a process accesses shared resource), process acquires semaphore from
before executing critical section codes
uC/OS
RTOS from Micrium Corporation that support over 100 different processor
architectures ranging from 8-bit to 64-bit
The Real-Time Kernel is a highly portable, ROMable, very scalable, fully
preemptive, deterministic
Allows integration with other software packages such as μC/TCP-IP, μC/GUI,
μC/File System, μC/USB, μC/CAN, μC/Modbus, μC/Bluetooth for obtaining greater
scalability and performance
Certified by FAA to be used in avionics
VxWorks
Multitasking RTOS from Wind River. It is hard real time.