CS2257

Exp# 4a

Operating System Lab

FCFS Scheduling

Aim To schedule snapshot of processes queued according to FCFS (First Come First Serve) scheduling.

Algorithm 1. 2. 3. 4. 5.

Define an array of structure process with members pid, btime, wtime & ttime. Get length of the ready queue, i.e., number of process (say n) Obtain btime for each process. The wtime for first process is 0. Compute wtime and ttime for each process as: a. wtimei+1 = wtimei + btimei b. ttimei = wtimei + btimei 6. Compute average waiting time awat and average turnaround time atur 7. Display the btime, ttime and wtime for each process. 8. Display GANTT chart for the above scheduling 9. Display awat time and atur 10. Stop

Result Thus waiting time & turnaround time for processes based on FCFS scheduling was computed and the average waiting time was determined.

http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

Program /* FCFS Scheduling

- fcfs.c */

#include struct process { int pid; int btime; int wtime; int ttime; } p[10]; main() { int i,j,k,n,ttur,twat; float awat,atur; printf("Enter no. of process : "); scanf("%d", &n); for(i=0; i
http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

printf("\n FCFS Scheduling\n\n"); for(i=0; i<28; i++) printf("-"); printf("\nProcess B-Time T-Time W-Time\n"); for(i=0; i<28; i++) printf("-"); for(i=0; i
http://cseannauniv.blogspot.com

Vijai Anand

CS2257

Operating System Lab

Output $ gcc fcfs.c $./a.out Enter no. of process : Burst time for process Burst time for process Burst time for process Burst time for process

4 P1 P2 P3 P4

(in (in (in (in

ms) ms) ms) ms)

: : : :

10 4 11 6

FCFS Scheduling ---------------------------Process B-Time T-Time W-Time ---------------------------P1 10 10 0 P2 4 14 10 P3 11 25 14 P4 6 31 25 ---------------------------GANTT Chart ---------------------------------------| P1 | P2 | P3 | P4 | ---------------------------------------0 10 14 25 31 Average waiting time : 12.25ms Average turn around time : 20.00ms

http://cseannauniv.blogspot.com

Vijai Anand

FCFS Scheduling

To schedule snapshot of processes queued according to FCFS (First Come First Serve) scheduling. Algorithm. 1. Define an array of structure process with members pid, btime, wtime & ttime. 2. Get length of the ready queue, i.e., number of process (say n). 3. Obtain btime for each process. 4. The wtime for first process is 0. 5.

10KB Sizes 0 Downloads 51 Views

Recommend Documents

Insertion Scheduling: An Alternative to List Scheduling ...
constraints between the tasks, build a schedule which satisfies the precedence and the ... reservation vector, for the conditional stores of the DEC Alpha 21064.

planning and scheduling
ment of PDDL (Planning Domain De nition Language), a language for ... Satisfaction (CSP) or Constraint Programming. The dis- ..... cision Procedure for AR.

planning and scheduling
from those arising in more realistic application domains. Real-sized planning domains are ... development of problems with increasingly complex fea- tures. Functional to the ..... to the problem of plan life-cycle management. REFERENCES.

Block Scheduling at Kingswood.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item.

[EBOOK] Maintenance Planning and Scheduling ...
PDF Download Maintenance Planning And Scheduling Handbook Full Online, ... Planning And Scheduling Handbook pdf ebook, Download Best Book .... used to present documents in a manner independent of application software, ... You can download textbooks a

[PDF] Maintenance Planning and Scheduling ...
... the software International Journal of Engineering Research and Applications .... additions to the business case for planning and scheduling, new case ... and a new appendix illustrating how to easily conduct an in-house productivity study.

Download Construction Planning and Scheduling
designed for construction management, planning and scheduling. ... click the downloaded file to install the software Pink Pigs in Mud English and ... this window and PRESS F5 to view this edition Find the latest business news on Wall ... housing mark

Google Calendar Basics Training Doc, Scheduling & Settings ...
Google Calendar Basics Training Doc, Scheduling & Settings - Google Drive.pdf. Google Calendar Basics Training Doc, Scheduling & Settings - Google Drive.

Web-scale Job Scheduling - CS - Huji
other issues in Web cluster management that, while not the focus of this paper, ... as the sum value in the database must be accurate to within the past few ..... some problems and challenges, as well as describing some working novel solutions.