0% found this document useful (0 votes)
58 views

Lab Final Project

The document discusses deadline monotonic scheduling, a static priority scheduling algorithm used in real-time operating systems. It provides an overview of deadline monotonic scheduling, describing how it assigns priorities inversely proportional to task deadlines to minimize deadline violations and optimize system performance.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Lab Final Project

The document discusses deadline monotonic scheduling, a static priority scheduling algorithm used in real-time operating systems. It provides an overview of deadline monotonic scheduling, describing how it assigns priorities inversely proportional to task deadlines to minimize deadline violations and optimize system performance.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

LAB PROJECT

DEADLINE MONOTONIC SCHEDULING

 Submitted to : Sir Shahzad

 Submitted by : Syeda Farwa Batool

 Roll no : 2022 – BSE - 071

 Course : Operating Systems


INTRODUCTION:

 Breif overview of operating system:


An operating system (OS) is a software that manages computer
hardware and provides a user interface for applications. It serves as an
intermediary between users and the computer's hardware, handling tasks
like memory management, file system organization, and process
scheduling. The OS enables communication between software and
hardware components, ensuring efficient and secure operation.
Examples include Windows, macOS, and Linux. OSes come in various
types, including single-user and multi-user systems, real-time systems,
and networked environments, catering to diverse computing needs.
 Importance of scheduling in operating systems :
Scheduling in operating systems is crucial as it ensures efficient
utilization of computer resources. By managing the order in which tasks
or processes are executed, scheduling minimizes idle time and
maximizes overall system performance. It helps balance the workload,
preventing any single process from monopolizing resources and causing
slowdowns. Effective scheduling contributes to improved response times
for user interactions and enhances the overall user experience.
Additionally, it plays a vital role in multitasking environments, allowing
multiple programs to run concurrently. Scheduling algorithms aim to
optimize CPU usage, minimize waiting times, and prioritize critical
tasks, contributing to the overall stability and responsiveness of the
operating system.
 Introduction to real time operating systems :
Real-time operating systems (RTOS) are specialized software designed
for systems where timely and predictable execution is critical. Unlike
general-purpose operating systems, RTOS ensures that tasks are
completed within specific deadlines. These systems are commonly used
in applications such as aerospace, industrial automation, and medical
devices, where precise and immediate responses are essential. RTOS
prioritizes tasks based on their urgency, providing a deterministic
environment for time-sensitive processes. It guarantees reliable and
predictable performance, making it suitable for applications that demand
real-time responses to external stimuli.
 Motivation for deadline monotonic scheduling :
Deadline Monotonic Scheduling (DMS) is motivated by the need for
effective real-time task scheduling in systems where meeting deadlines
is critical. DMS assigns higher priority to tasks with shorter deadlines,
ensuring that time-critical jobs are executed first. This approach is
particularly suitable for scenarios where timely completion of tasks is
essential, such as in embedded systems, automotive control systems, and
critical infrastructure. DMS minimizes the likelihood of missing
deadlines, enhancing system reliability. By prioritizing tasks based on
their deadlines, it optimizes resource utilization and helps prevent
performance degradation in time-sensitive applications. The simplicity
and efficiency of DMS make it an attractive choice for real-time systems
that demand predictable and deterministic task scheduling.
 Types of real time scheduling algorithms :
Real-time scheduling algorithms are categorized into two main types:
static (or fixed-priority) and dynamic (or adaptive-priority). Static
algorithms include Rate-Monotonic Scheduling (RMS), where tasks
with shorter periods receive higher priority, and Deadline Monotonic
Scheduling (DMS), prioritizing tasks based on their deadlines. Earliest
Deadline First (EDF) is a dynamic algorithm that adjusts priorities
dynamically based on the next task deadline. Additionally, Least Laxity
First (LLF) is a dynamic scheduling algorithm that considers the time
remaining until a task's deadline. Hybrid approaches, like the earliest
deadline-based hybrid (EDF-Hybrid), combine static and dynamic
scheduling principles to address diverse real-time system requirements.
These algorithms play a vital role in meeting timing constraints and
optimizing resource utilization in real-time applications.
DEADLINE MONOTONIC SCHEDULING
ALGORITHM :
 Definition and Purpose:
Deadline Monotonic Scheduling (DMS) is a fixed-priority algorithm in
real-time systems where tasks are scheduled based on their deadlines.
The primary purpose is to ensure timely execution of tasks by assigning
priorities inversely proportional to their deadlines, thereby minimizing
the risk of missing critical deadlines and optimizing system performance.
 Key Concepts and Components:
The algorithm relies on key components such as a task set, a priority
assignment mechanism, and a scheduler. The task set comprises a
collection of tasks with associated deadlines, and the priority assignment
mechanism establishes the priority order based on these deadlines.
 Deadline Enforcement:
DMS enforces deadlines by prioritizing tasks in a way that tasks with
closer deadlines are assigned higher priority. This ensures that tasks are
executed in an order that meets their respective deadlines, minimizing
the chance of deadline violations.
 Algorithm Description:
The algorithm involves sorting tasks based on their deadlines in
descending order. Tasks with shorter deadlines receive higher priority.
The scheduler then executes tasks in this priority order, ensuring that
tasks with imminent deadlines are addressed first.
 Task Arrival and Completion:
Tasks arrive in the system over time, and the scheduler determines the
order of their execution based on the assigned priorities. Completion
occurs when a task finishes its execution within its specified deadline,
contributing to the overall efficiency of the system.
 Priority Assignment:
Priority assignment in DMS is crucial and is typically done
inversely proportional to task deadlines. The formula for priority
might be Priority = 1/Deadline, emphasizing that tasks with
shorter deadlines are assigned higher priority, highlighting their
urgency.
 Scheduling Decision:
The scheduling decision involves selecting the task with the highest
priority from the sorted task set for execution. The scheduler
continuously makes decisions to ensure that tasks are processed in a
manner that aligns with their deadlines.
 Mathematical Formula:
The mathematical formula for priority assignment is fundamental to
DMS. Priority = 1/Deadline establishes the relationship between priority
and deadlines, guiding the scheduler in determining the execution order.
 Advantages:
DMS excels in scenarios where meeting strict deadlines is crucial. It
provides determinism in task execution, simplifies priority assignment,
and is efficient for systems with predictable and fixed task behavior,
contributing to the overall reliability of the system.
 Limitations:
Despite its advantages, DMS may lead to suboptimal resource utilization,
particularly in dynamic environments. Accurate deadline estimations are
crucial for its effectiveness, and it may face challenges when dealing
with tasks exhibiting varying execution times, making it important to
consider its limitations in specific system contexts.
CASE STUDIES
Automotive Systems:
In automotive systems, Deadline Monotonic (DM) algorithms have been
successfully employed to manage real-time tasks such as engine control,
brake systems, and transmission control. The stringent deadlines
associated with these tasks make DM algorithms crucial for ensuring
timely and predictable execution.
Medical Devices:
Deadline Monotonic scheduling finds applications in medical devices,
where timely processing of data is critical for patient monitoring and
life-support systems. Examples include infusion pumps, pacemakers,
and other embedded systems in healthcare.
Telecommunication Networks:
Real-time communication in telecommunication networks relies on
meeting strict deadlines for data transmission and processing. DM
algorithms have been implemented to manage tasks in base station
controllers, ensuring the timely delivery of data and maintaining the
quality of service.
Aerospace Systems:
Avionics systems in aircraft demand precise timing for navigation,
communication, and control functions. DM algorithms play a crucial
role in scheduling tasks related to flight control, radar systems, and
communication interfaces, contributing to the safety and reliability of
aerospace systems.
REAL WORLD APPLICATIONS
The application of Deadline Monotonic algorithms extends across
various domains, providing solutions to meet stringent timing
requirements. Some notable real-world applications include:
Industrial Automation:
In manufacturing environments, DM algorithms are employed to control
robotic systems, ensuring precise coordination and synchronization of
tasks. This enhances efficiency, reduces production time, and minimizes
errors in automated processes.
Financial Systems:
Real-time financial trading systems heavily rely on DM algorithms to
process and execute transactions within tight deadlines. These
algorithms contribute to the reliability and responsiveness of electronic
trading platforms.
Energy Management Systems:
Deadline Monotonic scheduling is applied in smart grids and
energy management systems to optimize the scheduling of tasks
related to energy generation, distribution, and consumption. This
aids in maintaining the stability and efficiency of the power grid.

SUCCESS STORIES
Medical Robotics:
The successful implementation of Deadline Monotonic scheduling in
surgical robots has led to improved precision and reduced latency in
medical procedures. Surgeons can remotely operate robotic systems with
confidence in meeting critical task deadlines.
Embedded Systems in Consumer Electronics:
The application of DM algorithms in consumer electronics, such as
smart TVs and IoT devices, has led to enhanced user experiences. Real-
time processing ensures smooth video streaming, responsive interfaces,
and reliable performance in diverse electronic devices.
CHALLENGES
Scalability:
As systems grow in complexity, ensuring scalability of Deadline
Monotonic algorithms becomes a challenge. Adapting these algorithms
to handle an increasing number of tasks while maintaining efficiency
and meeting deadlines requires careful design and optimization.
Dynamic Environments:
Real-world scenarios often involve dynamic changes in task priorities or
unexpected events. Adapting DM algorithms to handle dynamic
environments and ensuring graceful degradation in the face of
unforeseen challenges remains an ongoing research and implementation
challenge.
CODE IMPLEMENTATION

First I created input file :

Write input values into it . This input represents set of tasks, each
defined by three values :- computation time, deadline, and period.
The first line line (6) indicates the total number of tasks
Then I created another file in which I write code :
Now , the output is :

You might also like