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

Theory Assignment of AI

The document describes the least slack time (LST) scheduling algorithm. [1] LST is a real-time scheduling algorithm that assigns priority based on the slack time of a process, where slack time is the amount of time left until a job's deadline if it were to start now. [2] It selects processes with the smallest slack time (S) calculated as S=(d-t)-c', where d is the deadline, t is the current time, and c' is the remaining computation time. [3] LST is useful for systems with aperiodic tasks as it does not make assumptions about event rates, though it is suboptimal during brief overloads and with uninterruptible processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Theory Assignment of AI

The document describes the least slack time (LST) scheduling algorithm. [1] LST is a real-time scheduling algorithm that assigns priority based on the slack time of a process, where slack time is the amount of time left until a job's deadline if it were to start now. [2] It selects processes with the smallest slack time (S) calculated as S=(d-t)-c', where d is the deadline, t is the current time, and c' is the remaining computation time. [3] LST is useful for systems with aperiodic tasks as it does not make assumptions about event rates, though it is suboptimal during brief overloads and with uninterruptible processes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Theory Assignment of AI

Topic. Minimum/Least Slack time scheduling Algorithm.

General Description. Least slack time (LST) scheduling is a scheduling algorithm. It assigns
priority based on the slack time of a process. Slack time is the amount of time left after a job if
the job was started now. This algorithm is also known as least laxity first. Its most common use
is in embedded systems, especially those with multiple processors. It imposes the simple
constraint that each process on each available processor possesses the same run time, and that
individual processes do not have an affinity to a certain processor. This is what lends it a
suitability to embedded systems.

Slack time. This scheduling algorithm first selects those processes that have the smallest "slack
time". Slack time is defined as the temporal difference between the deadline, the ready time
and the run time. More formally, the slack time S for a process is defined as:

S=(d-t)-c'

where d is the process deadline, t is the real time since the cycle start, and c' is the remaining
computation time.

Applications. In real-time scheduling algorithms for periodic jobs, an acceptance test is needed
before accepting a sporadic job with a hard deadline. One of the simplest acceptance tests for a
sporadic job is calculating the amount of slack time between the release time and deadline of
the job.

Suitability. LST scheduling is most useful in systems comprising mainly aperiodic tasks, because
no prior assumptions are made on the events' rate of occurrence. The main weakness of LST is
that it does not look ahead, and works only on the current system state. Thus, during a brief
overload of system resources, LST can be suboptimal. It will also be suboptimal when used with
uninterruptible processes. However, like earliest deadline first, and unlike rate monotonic
scheduling, this algorithm can be used for processor utilization up to 100%.
Simulation.

Suppose,

Task Ø (Cycle Start Time) c’ d P (Total Period)


T1 0 3 7 15
T2 0 2 4 5
T3 0 2 8 10

Here, Highest period of task is 15. Let’s assume a 15-slot schedule.

0 1 2 3 4 5 6 7 8 9 10

11 12 13 14 15

After marking the deadlines and total period of three tasks,

0 1 2 3 4(T2D) 5(T2P) 6 7(T1D) 8(T3D) 9(T2D) 10(T2P,T3P)

11 12 13 14(T2D) 15(T1P, T2P)

Each after the consuming Execution period & Deadline the slots will be repeated.

Only if

Hp Mod P1….Pn/ D1…..Dn ≠ 0.

Calculation.

For T1, S1= (d1-c’1-t1)= (7-0-3)=4


For T2, S2= (d2-c’2-t2)= (4-0-2)=2
For T3, S3= (d3-c’3-t3)= (8-0-2)=6

Minimum Slack(S1,S2,S3)= S2. So, T2 will get the schedule.


T2
0 1 2 3 4(T2D) 5(T2P) 6 7(T1D) 8(T3D) 9(T2D) 10(T2P,T3P)

Now the cycle start time will be 1 for all tasks. As 1 task of T2 is completed so the task will
reduce by one. Doing the same calculations we get,

T2 T2 T1 T1 T1 T3 T3 T2 T2 …..
0 1 2 3 4(T2D) 5(T2P) 6 7(T1D) 8(T3D) 9(T2D) 10(T2P,T3P)

………… ………… …………. ……….


11 12 13 14(T2D) 15(T1P, T2P)

Some points for calculation,


1. If slack of tasks become equal then we will give priority to continuing task basing on the
tasks left.
2. After repetition of period, the cycle start time will be 0 for any particular tasks.

You might also like