Warm Brown Aesthetic Fashion Brand Marketing Presentation 16 : 9

Published on Slideshow
Static slideshow
Download presentation
Download Presentation
Download PDF version
Download PDF version
Embed video
Share video
Ask about this video

Scene 1 (0s)

[Audio] ASSALAM-O-ALAIKUM Thank you for joining me today as I present SHORTEST JOB FIRST Scheduling. One of the most important topic of Operating Systems. Our group members are Areej Nasim , Aliza Rehman,Salma Miraj and Eeman naeem and we are delighted to have this opportunity to share this information with all of you. Together, we will explore, learn, and gain a deeper understanding of this topic. So, let's begin!.

Scene 2 (28s)

[Audio] During this presentation, we will explore what is CPU scheduling and then we will discuss SJF its example and types and then we will also discuss advantages and disadvantages of sjf . By the end of our time together, you will have a solid understanding of Shortest Job First scheduling..

Scene 3 (48s)

[Audio] First of all we'll discuss what CPU Scheduling is so CPU scheduling is a fundamental concept in operating systems that involves the efficient allocation of the CPU (Central Processing Unit) to different processes or tasks in a computer system. Its goal is to maximize the overall system performance and ensure fair utilization of system resources. In a computer system, multiple processes are competing for the CPU's attention, and the CPU scheduler decides which process gets to execute and for how long. The scheduler makes these decisions based on specific algorithms and criteria..

Scene 4 (1m 7s)

[Audio] There are various CPU scheduling algorithms, each with its own characteristics and objectives. Some commonly used algorithms include First-Come-First-Serve (FCFS), Shortest Job Next (SJN), Round Robin (RR), and Priority Scheduling. In this video we're only discussing about Shortest Job First (SJF) Scheduling..

Scene 5 (1m 34s)

[Audio] Shortest Job First (SJF) is a CPU scheduling algorithm that aims to minimize the waiting time of processes by prioritizing the ones with the shortest burst time. In SJF scheduling, the process with the smallest execution time is selected first for CPU execution..

Scene 6 (1m 56s)

[Audio] The basic idea behind SJF is to estimate the burst time of each process or task and schedule them in ascending order based on their estimated times. The process with the shortest estimated time is given the CPU first, ensuring quicker completion and reduced waiting time. In summary, Shortest Job First (SJF) is a CPU scheduling algorithm that selects the process with the smallest burst time first for execution. It aims to minimize waiting times and improve system efficiency by prioritizing short jobs..

Scene 7 (2m 33s)

[Audio] SJF can be implemented in two ways: non-preemptive and preemptive..

Scene 8 (2m 44s)

[Audio] In the non-preemptive approach, once a process starts executing, it continues until it completes or blocks, without being interrupted. The non-preemptive SJF scheduling works by selecting the process with the smallest burst time from the ready queue and allocating the CPU to it. The burst time represents the time required for a process to complete its execution. The main characteristic of non-preemptive SJF is that the selected process runs to completion without any interruptions, regardless of whether shorter processes arrive later. This means that once a process is given the CPU, it holds it until it finishes its execution or blocks..

Scene 9 (3m 27s)

[Audio] Let's consider a simple example to illustrate how non-preemptive Shortest Job First (SJF) works: Assume we have four processes with their respective burst times: Process A: 7ms Process B: 4 ms Process C: 1ms Process D: 4 ms In non-preemptive SJF, the scheduler selects the process with the smallest burst time from the ready queue and allows it to run until it completes. So, let's see how the processes are scheduled: Step 1: Initially, the ready queue is empty. Step 2: Process A arrives. Step 3: The scheduler checks the ready queue and finds Process A with a burst time of 7 ms. Since it is the only process, it is selected for execution. Step 4: Process A runs for 7ms and completes its execution. Step 5: Process B arrives. Step 6: The scheduler checks the ready queue and finds Process B with a burst time of 4 ms. It is selected for execution. Step 7: Process B runs for 4 ms and completes its execution. Step 8: Process C arrives. Step 9: The scheduler checks the ready queue and finds Process C with a burst time of 1 ms. It is selected for execution. Step 10: Process C runs for 1ms and completes its execution. Step 11: Process D arrives. Step 12: The scheduler checks the ready queue and finds Process D with a burst time of 4 ms. It is selected for execution. Step 13: Process D runs for 4ms and completes its execution. In this example, the non-preemptive SJF scheduling algorithm executed the processes in the order p1, p3, p2, and p4. The total waiting time for the processes can be calculated by adding up the waiting times of each process. Average Waiting Time = (0 + 6+ 3+ 7) / 4 = 16 / 4 = 4ms Therefore, the average waiting time for the processes in this example, using non-preemptive SJF, is 4ms..

Scene 10 (6m 26s)

[Audio] On the other hand, in the preemptive approach, if a new process arrives with a shorter burst time than the one currently executing, the CPU is preempted, and the new process is given priority. Preemptive Shortest Job First (SJF) is a CPU scheduling algorithm in which the CPU can be preempted or interrupted to allocate it to a process with a shorter burst time. It prioritizes processes based on their remaining burst time rather than their initial burst time. In preemptive SJF, the scheduler continuously evaluates the ready queue and selects the process with the smallest remaining burst time. If a new process arrives with a shorter burst time than the one currently executing, the CPU is preempted, and the new process is given priority..

Scene 11 (7m 17s)

[Audio] Now Let's consider an example with four processes to illustrate preemptive Shortest Job First (SJF): Process 1: Arrival Time = 0 ms, Burst Time = 7ms Process 2: Arrival Time = 2 ms, Burst Time = 4 ms Process 3: Arrival Time = 4ms, Burst Time = 1ms Process 4: Arrival Time = 5ms, Burst Time = 4ms In preemptive SJF, the scheduler continuously evaluates the ready queue and selects the process with the smallest remaining burst time. Let's see how the processes are scheduled: Step 1: Initially, the ready queue is empty. Step 2: Process 1 arrives. Step 3: The scheduler checks the ready queue and finds Process1 with a burst time of 7ms. It is selected for execution. Step 4: Process 1 runs for 0ms and is interrupted by the arrival of Process 2 with a burst time of 4 ms. The scheduler compares the remaining burst time of Process 1 (7ms) and Process 2 (4 ms) and gives priority to Process 2. Step 5: Process 2 runs for 3ms and is interrupted by the arrival of Process 3 with a burst time of 1 ms. The scheduler compares the remaining burst time of Process 2 (4ms) and Process 3(1ms) and gives priority to Process 3 since it arrived first. Step 6: Process 2 runs for 2ms and is interrupted by the arrival of Process 4 with a burst time of 4ms. The scheduler compares the remaining burst time of Processes and gives priority to Process 2. Step 7: Process 2 runs completes its execution. Step 8: Process 4 runs for 5 ms and is interrupted by the arrival of Process 3 with a burst time of 1ms. Step 9: Process 3 and Process 4 runs and completes its execution. In this example, the preemptive SJF scheduling algorithm executed the processes in the order p1,p2,p3,p4 The total waiting time for the processes can be calculated by adding up the waiting times of each process. Average Waiting Time = (9 + 1 + 0+ 2) / 4 = 12 / 4 = 3 ms Therefore, the average waiting time for the processes in this example, using preemptive SJF, is 3ms..

Scene 12 (10m 25s)

[Audio] Shortest Job First (SJF) scheduling algorithm offers several strengths: Minimizes Waiting Time: SJF aims to minimize the waiting time of processes by prioritizing those with the shortest burst time. This leads to quicker execution and reduced waiting times for processes overall. Optimal for Known Burst Times: If the burst times of processes are accurately known or predictable, SJF can achieve optimal performance by scheduling the shortest jobs first. This can result in improved system efficiency. Reduces Turnaround Time: By executing shorter processes first, SJF can reduce the average turnaround time, which is the time taken from process arrival to its completion. This leads to faster completion of processes and increased system throughput. Fairness: SJF provides fairness in the sense that shorter jobs are prioritized, ensuring that they get executed promptly. This prevents longer jobs from monopolizing the CPU and reduces the likelihood of starvation for shorter processes. Efficiency for Batch Systems: SJF is particularly effective in batch systems where the arrival times and burst times of processes are known in advance. It can optimize the utilization of system resources and improve overall system performance. Suitable for Non-Interactive Workloads: SJF is well-suited for non-interactive workloads, such as batch processing or background tasks, where the scheduling decisions can be made based on the characteristics of the processes rather than user interactions..

Scene 13 (12m 16s)

[Audio] Difficulty in accurate prediction: SJF requires precise knowledge of the burst time of each process in advance. However, in practical scenarios, accurately predicting the exact burst time of processes can be challenging, especially for dynamic workloads or when there is variability in process execution times. Possibility of starvation: In non-preemptive SJF, longer processes can suffer from starvation. If a steady stream of shorter processes keeps arriving, longer processes might need to wait indefinitely until all shorter processes have been executed. This can lead to unfairness and delays for longer processes. Susceptibility to process arrival order: SJF scheduling heavily relies on the order in which processes arrive. If long processes arrive first, they might need to wait for shorter processes to complete, increasing their waiting time and overall execution time. Lack of responsiveness: In non-preemptive SJF, once a process starts executing, it cannot be interrupted until it completes or blocks for I/O. This lack of responsiveness can be problematic in interactive systems or situations where processes require immediate attention. Difficulty in implementation: SJF requires maintaining accurate estimates or knowledge of the burst times, which can be cumbersome and may require additional monitoring and tracking mechanisms. It adds complexity to the scheduling algorithm and may not be practical in all environments. Inherent overhead: Determining the shortest job among all available processes at any given moment requires constant scanning or sorting of the ready queue, which can introduce additional overhead and computational costs..

Scene 14 (14m 14s)

[Audio] In short SJF is a scheduling algorithm that prioritizes processes with the shortest burst time, aiming to minimize waiting times and improve system efficiency, but it lacks preemption and relies on accurate burst time estimates..

Scene 15 (14m 39s)

[Audio] Thank you all for being here, and I hope you find this presentation both informative and engaging..