Professional Documents
Culture Documents
Assignment No 2
Student Name:Sheharyar Nadeem
Student iD;Bc180405023
Question No 1:
Solution:
Program1
#include<stdio.h>
#include<string.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<sys/errno.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdlib.h>
int main()
int fd ;
mkfifo(fifo_one , 0666) ;
//printf("") ;
close(fd) ;
}
Program2
#include<string.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<sys/errno.h>
#include<fcntl.h>
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
int main()
int fd1 ;
mkfifo(fifo_one , 0666) ;
close(fd1) ;
}
Screenshot:
______________
QuestionNo 2:
Consider the following threeprocesses, with the Arrival time and CPU burst time,is given in
milliseconds:
A. Draw a Gantt chart showing the execution of three processes using the Shortest
Remaining Time First (SRTF) scheduling.
B. Find the turnaround time of each process for the SRTF Shortest Remaining Time First
scheduling algorithm as per the Gantt chart.
C. Calculate the waiting time for the three processes for the SRTF Shortest Remaining Time
First scheduling algorithm as per the Gantt chart?
Solution:
P1 0.0 3
P4 1.0 8
P3 3.0 6
P1 P1 P1 P3 P3 P3 P3 P3 P3 P4 P4 P4 P4 P4 P4 P4 P4
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
P1 P3 P2
0 3 9 17
____________________