Ass 1

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

Qn1a

HARD REAL-TIME SYSTEMS


 These are computer systems that have a strict timing constraints such that they
produce results within certain predefined time bounds.
 Applications having hard real-time tasks are safety-critical in that any failure to meet
a deadline would result in severe consequences. This makes them extremely critical.
 Hard real-time systems are usually used in embedded systems like a car engine
control system.
 The system’s response time must be predictable and consistent.
 Tasks in hard real-time systems must meet deadlines else they encounter system.
failure and lead to severe consequences.
 Examples of hard real-time systems are; 1. Flight control systems in airplanes. 2.
Manufacturing robots, in coordinating precise movements to assemble components
with a great degree of accuracy.

SOFT REAL-TIME SYSTEMS


 These systems also have time bounds associated with them, but the timing
constraints are not expressed as absolute values
 They are not as urgent as hard real-time systems but they still need to produce
positive results.
 In such systems, a delay of a few milliseconds won’t cause any drastic consequences.
 The utility of the results produced by the system falls continuously with time after
the expiry of the deadline.
 Examples of application include use in automated teller machines, and also web
browsing. Missed deadlines will not pose any harm but the system will be said to be
slow.

Qn1b
The temporal parameters of a real-time workload refer to the timing features that must be
considered when analyzing and scheduling in a real-time system. The parameters include;
- Jitter: This refers to the variation in the start or end times of a task as influenced by
factors such as scheduling delays or system interrupts. The release time for each job
is either ri-, the earliest, or ri+, the latest, and this range is called the release time
jitter.
- Execution Time: This is the time required to complete the execution of a single job
when it executes individually and has all the resources at its disposal. The execution
time vary depending on the input data.
- Deadline: This a point in time by which a task is expected to be completed to ensure
that the system functions correctly. The deadlines can be in the form of hard or soft
as mentioned earlier, and meeting deadlines is crucial in real-time systems to
prevent system failures.
- Period: This is the amount of time between successive instances of a task. It defines
how often the task needs to be executed and tasks with shorter periods are
considered more critical as they require more frequent processing.
Qn1c
A periodic task model is a scheduling algorithm that ensures that all tasks run on time.
Each data transmission or computation that is executed repeatedly at regular or semi-
regular time intervals in order to provide a function of the system is modelled as a
period task.
Each task is characterized by:
- RELEASE TIME: The time when the task is first released.
- PERIOD (T): The interval between which tasks are executed.
- RELATIVE DEADLINE(D): The maximum accepted delay between task processing.
- RESPONSE TIME: The time taken from when the task is released until it
completes its execution.
- WORST-CASE EXECUTION TIME: This is the maximum time it will take to execute
under any circumstances. It helps determine the feasibility of meeting task
deadlines.

Qn2a
Hard real-time systems have strict timing requirements and must complete all their tasks within a
specific time frame. A network that ensures deterministic latency and reliable delivery of messages
within a predetermined time frame is called hard real-time communication. For example, a system
that triggers the airbag in a vehicle, in case of a collision. If it doesn't trigger the airbag within a
certain time frame, there could be serious consequences. Other examples include the autopilot
systems and medical systems.

Soft real-time systems have less strict timing requirements and can tolerate more delays than hard
and firm real-time systems. These systems prioritize completing tasks efficiently, with exact timing
being less critical. For example, a system that tracks the stock market prices and displays them on a
computer screen. If there's a small delay in updating the prices, it's not a big deal.

Qn2b
This refers to the relationship and constraints that exists between different tasks in a
system. The dependencies affect the scheduling and execution of jobs and play a crucial role
in determining the overall performance as well as the efficiency of the system. They include;
- PRECEDENCE DEPENDENCIES: They specify the order in which jobs should be
executed. A job must wait for one or more other jobs to complete before it can start.
For example, task 1 must be completed before task 2 can begin.
- DATA DEPENDENCIES: They occur when the output of one task is required as the
input of another task. It ensures that jobs are executed in the correct sequence to
maintain data consistency. For example, if task 1 requires the output of task 2 as its
input, it will have to wait until task 2 is executed.
- RESOURCE DEPENDENCIES: These occur when tasks or jobs require access to limited
resources, such as shared database, network connection, or hardware device. Tasks
may have to wait until resources are available before they can be executed. For
example, if 2 tasks require exclusive access to a printer, one task will use the printer
at a time.
- TEMPORAL DEPENDENCIES: They Define the timing relationships between tasks.
These dependencies specify constraints on the start and finish times of tasks. This
will ensure that certain jobs are executed within a specific time window or deadline.
- SYNCHRONIZATION DEPENDENCIES: Ensures that2 or more jobs are executed in
synchronization with each other. This means that other tasks will have to wait for
others to be completed for them to be executed, or they may need to be
synchronized to ensure consistency and avoid clashes. For example, a job that
updates a data base may need to be synchronized with another job that reads data
from the same database to prevent data corruption.

Qn2c
Various functional parameters that can affect access control of resources within a system
helps in determining who can access what resources and what actions they can perform.
Some of the key parameters include;
- USER ROLES: They define the level of access possessed by the user within a system.
Roles can be assigned to users based on their job function, responsibilities, and level
of authority. Access control can be effectively managed by granting or denying
access based on these roles, thereby defining user roles.
- AUTHENTICATION MACHANISMS: Such mechanisms verify the identity of a user
before granting permission to resources. This includes application such as
biometrics, passwords, two-factor authentication, and single sign-on. Only
authorized users can access resources by making use of strong authentication
mechanisms.
- AUTHORIZATION POLICIES: They define rules and conditions that determine actions
that a user can perform once they have been authenticated. These policies specify
the level of access a user has to specific resources based on criteria such as their role
or group membership.
- ACCESS CONTROL LISTS: ACLs are lists of permissions associated with specific
resources, specifying who has access to those resources. They can be used to control
access at the file level, application level or network level.
- AUDIT TRAILS: Audit trails help track access to resources by recording and
monitoring user activities. Audit trails help by making sure they log who accessed
what resources, when the access occurred and what actions where performed.

Qn3a
This is a type of scheduling algorithm used in real-time operating and embedded systems.
Tasks are assigned a priority level, and the scheduler selects the task with the highest
priority to execute next. Hence, tasks with a higher priority are given precedence over tasks
with lower priority levels. They are most suitable in hard real-time systems where timely
task completion is essential since time-critical tasks are completed in their deadlines.
Priority-driven scheduling does not require the information on the execution or release
times of the jobs a priori. Algorithms for scheduling are classified as fixed-priority and
dynamic priority. Each algorithm has its set of rules for assigning and adjusting task priorities
to meet system requirements Fixed-priority algorithm prioritizes all the jobs in each task.
Dynamic-priority algorithm assigns different priorities to each job in each task.
For example, a traffic control system that uses priority-driven scheduling to keep the roads
moving smoothly works as follows;
Task A (the red light for north bound traffic) is given a higher priority because it is very
crucial in preventing accidents.
Task B (the green light for southbound traffic) is given a medium priority because it is
important but not as urgent as task A.
Task C (traffic signal for pedestrians) is given low priority because it is not that critical as to
the overall traffic.
When there is a lot of traffic on the road and the system is running at full capacity, Task A
will always be given priority over tasks B and C.

Qn3b
Challenges in validating timing constraints in priority-driven system;
i. The timing behavior of a priority-driven system is not deterministic.
ii. It is difficult to validate that all jobs scheduled in a priority-driven manner meet their
predetermined deadlines, when they have variable job parameters.
iii. Priority-driven systems are not as deterministic as the time-driven systems so it is
difficult to characterize their timing.
iv. If a task doesn’t meet its execution deadline, the system won’t behave as expected
which is not the objective of real-time systems.
v. A high-priority task may get stuck waiting for a low-priority task, which can stall up
the system’s responsiveness.
vi. Figuring out if a set of tasks can meet their deadlines under a particular scheduling
algorithm can be challenging.
vii. Tasks in priority-driven systems may compete for shared resources such as
communication channels or memory and this can lead to variability in task execution
times thereby making it challenging to validate their timing constraints.
viii. Complex timing constraints may also result when tasks in a priority-driven system
have dependencies on each other.
Qn3c
- A static timer-driven scheduler is an algorithm that uses a predefined schedule to
execute tasks at specific intervals.
- It uses a timer to periodically check if a task is supposed to run based on the
predefined schedule.
- If a task is supposed to run, the scheduler allocates resources to the task so it can
start running.
- The timings are known prior the execution so it will be easy to predict the system’s
behavior.
- If a system is small or has a simple and predictable workload, a static timer-driven
scheduler can be a best choice.
- Since the scheduling decisions are made statically at compile-run time, there is no
overhead associated with dynamic scheduling decisions at runtime which can lead to
consistent and predictable performance for real-time systems.
- Tasks with varying deadlines or execution times may not be efficiently handled by
this method.

Qn4a
A cyclic scheduler in the real-time system is a periodic static scheduler. In this scheduling
algorithm, tasks are assigned fixed time slots for execution. The general structure of cyclic
schedulers includes the following components;
- TASK SET: A collection of tasks that need to be scheduled for execution. Each task
will be characterized by its execution time, period, and deadline.
- SCHEDULE TABLE: This is a matrix that defines the timing requirements for each task
in the task set. It defines the start time, duration, and deadline for each task.
- SCHEDULING ALGORITHM: This is responsible for determining the order in which
tasks are executed as well as allocating time slots for each task based on the
schedule table.
- TIMER INTERRUPT: This is used to trigger the scheduler at regular intervals, enabling
it to make scheduling decisions as well as allocating time slots for tasks.
- TASK EXECUTION: Tasks are executed according to the schedule table as well the
scheduling algorithm. Each task is given a fixed timeslot within its period to complete
its execution.
- DEADLINE MONITORING: The scheduler monitors task deadlines to ensure that tasks
are completed within their specified deadlines.

Qn4b
There are several ways to improve the average response time of periodic jobs in a scheduling
system. Some of the key strategies include:

 Priority-based scheduling: Assigning higher priority levels to periodic jobs can ensure
that they are scheduled and executed more quickly, leading to better response times. This
can be achieved by using scheduling algorithms such as priority scheduling or earliest
deadline first (EDF) scheduling.

 Pre-emption: Allowing the scheduler to pre-empt lower-priority tasks in order to execute


high-priority periodic jobs can help reduce response times. This ensures that time-critical
tasks are given precedence over less important ones.

 Efficient task scheduling: Optimizing the task scheduling algorithm to minimize waiting
times, overhead, and context switching can also improve the average response time of
periodic jobs. This can be achieved by selecting appropriate scheduling policies and data
structures.

 Deadline monitoring: Implementing mechanisms to monitor task deadlines and ensuring


that tasks are completed within their allotted time frames can help prevent delays and
improve response times. This is especially important for real-time systems where
meeting deadlines is crucial.

 Resource allocation: Properly allocating resources, such as CPU bandwidth and memory,
to periodic jobs can prevent contention and bottlenecks that may lead to increased
response times. Balancing resource usage among tasks can help improve overall system
performance.

 Performance profiling and optimization: Analysing the performance of periodic jobs,


identifying bottlenecks, and optimizing critical sections of code can help reduce
execution times and improve response times. Regular

Qn4c
Weighted round robin (WRR) is a scheduling algorithm used in computer networking and
telecommunications to assign resources among certain users or data streams. It assigns
different weights to users, enabling other users to receive a larger share of resources than
others. WRR is a more flexible and efficient way for managing bandwidth allocation based
on varying demands and priorities.
In WRR, each user will be assigned a weight that corresponds to its share of resources. Users
assigned higher weights will get a large share, while lower weighted gets proportionally less.
ADVANTAGES: flexible resource allocation; WRR enables the prioritization of traffic; it
optimizes resource usage.
APPICATION: Network traffic management; resource scheduling in cloud computing.

Qn5a
Rate-monotonic scheduling is a priority algorithm that belongs to static real-time operating
systems. It is pre-emptive in nature and the priority is given according to the cycle time of
the processes that are involved. Jobs with a short duration are prioritized. The priority is
inversely proportional to the period it will run for. It consists of a calculated copy of the time
periods, unlike other time-sharing algorithms as WRR which neglects scheduling needs of
the processes. RMA will not be optimal in cases when the task period and deadline differ.
Example: Consider a system with three periodic tasks: Task A with a period of 20ms, Task B
with a period of 25ms, and Task C with a period of 35ms. The priorities would be assigned as
follows: Task A (highest priority), Task B, and Task C (lowest priority).
In Deadline Monotonic Scheduling, tasks are assigned priorities based on their deadlines,
with tasks having earlier deadlines being assigned higher priorities. The idea behind DMS is
to prioritize tasks that have impending deadlines to ensure that all deadlines are met.
Example: Suppose we have three tasks with deadlines as follows: Task X with a deadline of
30ms, Task Y with a deadline of 2Oms, and Task Z with a deadline of 15ms. In DMS, the
priorities would be assigned as follows: Task Z (highest priority), Task Y, and Task X.

Qn5c
Static assumptions in priority-driven scheduling of periodic tasks refer to certain
assumptions made about the system and its tasks that allow for the application of specific
scheduling algorithms, such as Rate
Monotonic Scheduling (RMS) or
Deadline Monotonic Scheduling (DMS). These assumptions are critical for the predictability
and correctness of the scheduling algorithms.
Some common static assumptions in priority-driven scheduling of periodic tasks include:
Periodicity: Tasks are assumed to be periodic, meaning they have a fixed and known period
at which they must execute. This assumption allows the scheduler to predict when tasks will
become ready to run again.
Determinism: Task execution times are assumed to be
deterministic, meaning that the time it takes for a task to complete is known and fixed. This
assumption is necessary for accurately predicting task deadlines and ensuring that tasks
meet their timing requirements.
Preemption: Tasks can be preempted by higher-priority
tasks. This allows the scheduler to ensure that tasks with higher priority can run
immediately when they become ready, even if a lower-priority task is currently running.
Fixed priorities: Tasks have fixed priority levels that do not change during runtime. This
assumption simplifies the scheduling algorithm and makes it easier to determine the order
in which tasks should be executed.
Independent tasks: Tasks are assumed to be independent of each other, meaning that they
do not share resources or dependencies that could lead to
conflicts or synchronization issues.
By making these static assumptions, priority-driven scheduling algorithms can discuss the
schedulable utilizations of EDF algorithms.
The schedulable utilizations of Earliest Deadline First (EDF)
scheduling algorithm depend on the characteristics of the tasks in the system, such as their
periods and deadlines. EDF is an optimal scheduling algorithm for uniprocessor systems, as
it guarantees that a feasible schedule exists if the utilization of the tasks in
the system does not exceed a certain
threshold.
The utilization bound for EDF scheduling on a uniprocessor system is given by the formula:
U = n(2^(1/n) - 1)
where:
- U is the maximum total utilization of all tasks in the system.
- n is the number of tasks in the system.
If the total utilization of the tasks in the system does not exceed the calculated utilization
bound, then EDF is able to schedule the tasks to meet all their deadlines. If the
utilization exceeds the bound, there is no guarantee that EDF will be able to schedule the
tasks successfully.
It's important to note that while EDF is optimal for uniprocessor systems, it may not be
optimal for multiprocessor systems or systems with more complex task dependencies. In
those cases,
different scheduling algorithms or approaches may be more suitable.

Qn6a
One well-known dynamic algorithm for priority-driven scheduling of periodic tasks is the
Earliest Deadline First (EDF) scheduling algorithm. In EDF scheduling, each task is assigned a
priority based on its deadline, with tasks having earlier deadlines being given higher priority.
The scheduler selects the task with the earliest deadline to execute next, ensuring that tasks
are completed in a timely manner and meeting their deadlines.
For example, let's consider three periodic tasks: Task A with a period of 10 ms and a
deadline of 8 ms, Task B with a period of 15 ms and a deadline of 12 ms, and Task C with
a period of 20 ms and a deadline of 18 ms. In this scenario, Task A has the earliest deadline
and would be scheduled first. If all tasks arrive at their specified intervals, the scheduler
would execute Task A at time 0 ms, followed by Task B at time 10 ms, and finally Task C, at
time 25 ms.
Overall, the EDF scheduling algorithm is effective in prioritizing tasks based on their urgency
and ensuring that deadlines are met in a dynamic environment where task arrival times may
vary.

Qn6b
In the Earliest Deadline First (EDF) scheduling algorithm, the optimality test can be
summarized as follows:
Sufficient Condition for Optimality: The EDF algorithm is optimal for scheduling periodic
tasks on a uniprocessor system if the task set is schedulable under any other priority-driven
scheduling algorithm.
Utilization-Based Test: One common optimality test for the EDF algorithm is based on the
utilization of the task set. The utilization of a task set is defined
as the sum of the ratio of each task's computation time to its period. If the total utilization
of the task set does not exceed 1, then the task set is said to be schedulable under EDF.
Response Time Analysis: Another approach to determine optimality in EDF scheduling is
through response time analysis. This involves calculating the worst-case response time of
each task in the task set and ensuring that it does not exceed its deadline. If all tasks meet
their deadlines under EDF scheduling, then the algorithm is considered optimal.
Rate-Monotonic Scheduling (RMS) Test: In some cases, the Rate-Monotonic Scheduling
(RMS) test can also be used as an optimality test for EDF scheduling. RMS assigns priorities
to tasks based on their periods, with shorter periods receiving higher priority. If a task
set is schedulable under RMS, then it is also schedulable under EDF.
Overall, these tests help determine whether the EDF algorithm can guarantee timely
execution and meet deadlines for periodic tasks in a priority-driven scheduling environment.
By ensuring that tasks
can be scheduled optimally under EDF, system designers can have confidence in the
reliability and efficiency of their real-time systems.

Qn7a
Assumptions:

- Fixed priorities: Tasks are assigned fixed priorities based on their importance and
deadline requirements. Higher-priority
- tasks are scheduled before lower-priority tasks.

- Preemption: Tasks can be preempted by higher-priority tasks if necessary to meet


deadlines.

- Task characteristics: Periodic tasks have fixed arrival times and execution times,
while sporadic

- tasks have varying arrival times and execution requirements.

Approaches:

- Rate-Monotonic Scheduling (RMS): This is a commonly used priority assignment algorithm in


real-time systems where tasks with shorter periods are assigned higher priorities. RMS
assumes
- that the task with the shortest period has the highest priority and is scheduled first.
- Earliest Deadline First (EDF) Scheduling: In this approach, tasks are prioritized based on their
earliest deadline. The task with the closest deadline is scheduled first to ensure that all
- tasks meet their respective deadlines.
- Sporadic Server Scheduling: Sporadic job scheduling handles tasks with unpredictable arrival
times and deadlines. A sporadic server is used to allocate CPU time to sporadic tasks based
on their requirements and
- guarantees that all sporadic tasks are executed within their specified time frame

Qn7b
Qn8a
Qn8b

You might also like