ES Module-3
ES Module-3
PART-A
Ready State
When the process creation gets completed, the process comes
into a ready state. During this state, the process is loaded into the
main memory and will be placed in the queue of processes which
are waiting for the CPU allocation.
Running State
Whenever the CPU is allocated to the process from the ready
queue, the process state changes to Running.
Terminated or Completed
When the entire set of instructions is executed and the process is
completed. The process is changed to terminated or completed
state. During this state the PCB of the process is also deleted.
2. Explain the different thread binding models for user and kernel
level threads.
5. Explain how threads and processes are related? What are the
common processes and threads?
Process:
Refer PART-A Q.1
Thread
● MTS
● Lynx
● QNX
● VxWorks etc.
For example, a robot is hired to weld a car body. If the robot welds
too early or too late, the car cannot be sold, so it is a hard
real-time system that requires complete car welding by robot
hardly on the time.
Processes start out with a single main thread. The main thread can
create new threads using a thread fork system call. The new
threads can also use this system call to create more threads.
Consequently, a thread not only belongs to a process; it also has a
parent thread - the thread that created it.
Semaphores are integer variables that are used to solve the critical
section problem by using two atomic operations, wait and signal
that are used for process synchronization.
Types of Semaphores
● Counting Semaphores
These are integer value semaphores and have an unrestricted
value domain. These semaphores are used to coordinate the
resource access, where the semaphore count is the number
of available resources. If the resources are added, semaphore
count automatically increments and if the resources are
removed, the count is decremented.
● Binary Semaphores
The binary semaphores are like counting semaphores but
their value is restricted to 0 and 1. The wait operation only
works when the semaphore is 1 and the signal operation
succeeds when semaphore is 0. It is sometimes easier to
implement binary semaphores than counting semaphores.
Performance
Features
Every RTOS doesn’t have the exact same features or the features
implemented in the most optimal manner. Developers need to
evaluate which features are the most critical to the system's
success and select an RTOS that has those features. Developers
may want to consider scalability, safety certifications or even the
efficiency of memory protection schemes
Cost
Ecosystem
Middleware
The process of deciding which task will utilize the cpu time is
called task scheduling. The scheduling of the task may be on the
basis of their priorities. The priority assignment mechanism for the
tasks can be either static or dynamic. In the case of static priority
assignment the priority of task is assigned as soon as the task is
created, thereafter the priorities cannot be changed. In dynamic
assigning the priorities of the task can be changed during the
runtime.
Task States
At any one moment in time, just one task is actually running. Aside
from CPU time spent running interrupt service routines (more on
that in the next article) or the scheduler, the “current” task is the
one whose code is currently being executed and whose data is
characterized by the current register values. There may be other
tasks that are “ready” (to run) and these will be considered when
the scheduler is executed.
Scheduling :
Priority Scheduler
3.10.0-1127.10.1.rt56.1106.el7
Multiprocessing in RTOS
Advantages
Multitasking in RTOS:
Multiprogramming in RTOS
ROLE: