Preview

operating system

Satisfactory Essays
Open Document
Open Document
464 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
operating system
1. AIM: To write a C program to simulate the shortest job first algorithm with preemption.
DESCRIPTION:
For implementing SJF algorithm with preemption, we consider the arrival times of each process, the burst times of all the previously arrived processes. After the arrival of all the processes into the ready queue, the average waiting time and turn around time can be calculated by using the above algorithm.
ALGORITHM:
1) start
2) read the no of processes to n
3) initialize i to 0
4) if ia[j] then
a) swap a[i] and a[j]
b) swap at[i] and at[j]
c) swap b[i] and b[j]
8) from i=0 to n do
a) w[i]=s-b[i]-at[i]
b) s=s+a[i]
c) avg=avg+w[i]
9)tt=tt+avg
10) tt=tt/n
11) avg=avg/n
12)write the turn around time and average waiting time
13) stop

2) AIM: To write a program on Shortest Job First algorithm with Non-Preemption
Description:
Initially, In the shortest job first algorithm with non-preemption, the sorting of the process can be done based on their burst time in ascending order. The above algorithm calculates the averaging waiting time and turn around time of each process .
ALGORITHM:
1) start
2) read the number of process into n
3) for i=0 to n step1 do
a) read the burst time of process into b[i]
b) check if b[i] is less than 0
i. write invalid input ii. goto step 11
c) tt = tt+b[i]
4) for i=0 to n do step1
i. for j=1 to n step1 do if b[i]>b[j] t=b[j] b[i]=b[j] b[j]=t 5) assign 0 to w[0]
6) for i=1 to n do w[i]=w[i-1]+b[i] avg=avg+w[i]
7) tt=tt+avg
8) avg=avg/n
9) tt=tt/n
10) Print the average waiting time and turn around time
11) Stop
3) Aim: To write a c program to simulate First Come First Served(FCFS)algorithm using
CPU Scheduling.
Description:
In FCFS algorithm, which ever the process that enters first in the ready queue will be allocated CPU first. Initially, the waiting time of the first process is kept zero. In this algorithm, the waiting time of the second process is the burst time of the first process

You May Also Find These Documents Helpful

  • Satisfactory Essays

    linux

    • 456 Words
    • 2 Pages

    1. What change is necessary to make sendmail listen to all network traffic on port 25? What file would you edit?…

    • 456 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Simul8 Report

    • 1272 Words
    • 6 Pages

    Figure 1 depicts the model used for the simulation, where the two types of calls enter the system through the two entry points - type 1 and type 2. They are then sorted and routed out to their respective queues through labels named ‘type’. Type 1 customers are served by either agent 1 or agent 3 (generalist), depending on availability. Similarly, type 2 customers are served by agent 2 or agent 3, after which the customers leave the system by their respective exit points.…

    • 1272 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    Operating System

    • 1099 Words
    • 5 Pages

    Answer: d. It redirects the output of one command to the input of another command.…

    • 1099 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    Cookies Case

    • 1553 Words
    • 7 Pages

    The time required to fill the “rush order” is: Process’s Throughput Time = NOTE: The answer of __ assumes that there no cookies in the oven, or, if there are cookies in the oven, the remaining baking time is at most 8 minutes. If cookies are in the oven and have a baking time in excess of 8 minutes, then, if the cookies are not removed from the oven, the time required to fill the “rush order” increases above __. 5…

    • 1553 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    MM1 simulation in Matlab

    • 884 Words
    • 4 Pages

    server_status = 0; % idle num_in _queue = 0; time_last _event = 0.0; % Initialize the statistical counters. num_custs_delayed = 0; total_of _delays = 0.0; area_num _in _queue = 0.0; area_server _status = 0.0; % Initialize event list.…

    • 884 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    7 Wastes

    • 1473 Words
    • 6 Pages

    Waiting time – Idle time in manufacturing because materials, information, people or equipment are not ready…

    • 1473 Words
    • 6 Pages
    Powerful Essays
  • Satisfactory Essays

    operating system

    • 778 Words
    • 5 Pages

    Short – Term Scheduler: Short term scheduler selects the processes that are ready to execute and allocates CPU to one of them.…

    • 778 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    conclusion that reducing the Order Lead Time until it is less than Tall, the allowable…

    • 19143 Words
    • 77 Pages
    Powerful Essays
  • Good Essays

    Objective:To learn about Insertion sort algorithm,know how it works and use it in real life.…

    • 470 Words
    • 2 Pages
    Good Essays
  • Good Essays

    In Linux, the two processing scheduling algorithms used for real time processes is Round Robin and First-in-First-out (FIFO). These two scheduling algorithms allow real-time processes to be executed in a timely fashion, and a time-sharing algorithm is used for all other processes. The time-sharing algorithms are prioritized and “credit-based”. The process with the most credits is selected, and while a process is running, it loses credits every time the timer interrupts occur. A process may no longer run if it has no more credits remaining. If the process that uses the time-sharing algorithm has no credits remaining, the system assigns credits. Also meaning the higher priority processes will then receive more credits.…

    • 487 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    * To reduce the changeover time, sequential processes need to be converted into parallel processes.…

    • 558 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    Sap Note 151503

    • 3662 Words
    • 15 Pages

    Process orders are generally scheduled both forwards and backwards. The scheduling type defines which scheduling direction is taken into account first. The dates of the earliest dates result from forward scheduling. The dates of the latest dates result from backward scheduling.…

    • 3662 Words
    • 15 Pages
    Powerful Essays
  • Good Essays

    operating system

    • 654 Words
    • 3 Pages

    An object file is a sequence of bytes organized into blocks that are understandable by the machine.…

    • 654 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Operating System

    • 802 Words
    • 4 Pages

    The basic structure of a computer normally consists of one or more of the following hardware components: • The CPU or the central processing unit, also called the processor • RAM or random access memory, also known as main memory • The massive storage devices, which store large amounts of data and programs in permanent form • The I/O devices or input/output units • The system bus, which provides interconnections for all components of the system…

    • 802 Words
    • 4 Pages
    Good Essays