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 1 Downloads 241 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.

Scheduling Fairness of Real-Time Scheduling ...
MExp, outage capacity, quality of service (QoS), scheduling fairness, ... Wireless industry has been making its way to the field of real-time multimedia applications. ... data applications over both wire-line and wireless channels, multiplexing ...

Fast Modulo Scheduling Under the Simplex Scheduling ...
framework, where all the computations are performed symbolically with T the .... Indeed the renewable resources in an instruction scheduling problem are the ...

Priority Scheduling
To schedule snapshot of processes queued according to Priority scheduling. Algorithm. 1. Define an array of structure process with members pid, btime, pri, wtime & ttime. 2. Get length of the ready queue, i.e., number of process (say n). 3. Obtain bt

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.

Bicriteria Scheduling for Parallel Jobs
Bicriteria Scheduling for Parallel Jobs. Dror G. Feitelson and Ahuva Mu'alem. School of Computer Science and Engineering. The Hebrew University, Jerusalem ...

Modulo Scheduling with Regular Unwinding
requires bi ≥ 0 resources for all the time inter- ..... Proof: We defined the modulo scheduling problem ... Definition 1 A q-stationary p-unwinded schedule is a.

CPU Scheduling Algorithm-Preemptive And Non- Preemptive
IJRIT International Journal of Research in Information Technology, Volume 2, Issue 10, ... The second queue is the device or the I/O queue which contains all the ...

Construction Planning and Scheduling
Online PDF Construction Planning and Scheduling: United States Edition, Read PDF Construction Planning and Scheduling: United States Edition, Full PDF Construction Planning and Scheduling: United States Edition, All Ebook Construction Planning and Sc

Scheduling your Hangout On Air - Services
Click the Q&A app on the left sidebar in the Hangout On Air. 4. After a moment, you'll see the app appear in the right sidebar with questions that have been submitted from the audience. 5. Click on a question and then answer it live. Later on, viewer

Task Scheduling and Moral Hazard∗
Dec 20, 2006 - Almost every business project can be viewed as a multitask activity which is extended over time and which is ... For example, consider an entrepreneur who is in the business of painting houses. She employs workers on a ..... Using Lemm

Timetable Scheduling using modified Clustering - IJRIT
resources to objects being placed in space-time in such a way as to satisfy or .... timetable scheduling database that has the information regarding timeslots of college. .... Java is a computer programming language that is concurrent, class-based, o