0% found this document useful (0 votes)
91 views

Assignment 1

The document contains 25 questions related to operating system concepts like CPU scheduling, process management, concurrency, and memory management. The questions cover topics such as scheduling algorithms, context switching, system calls, process synchronization, and inter-process communication. Students are asked to write programs in C demonstrating various OS concepts, draw Gantt charts, and calculate metrics like turnaround time and waiting time for different scheduling policies.

Uploaded by

Kashish Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
91 views

Assignment 1

The document contains 25 questions related to operating system concepts like CPU scheduling, process management, concurrency, and memory management. The questions cover topics such as scheduling algorithms, context switching, system calls, process synchronization, and inter-process communication. Students are asked to write programs in C demonstrating various OS concepts, draw Gantt charts, and calculate metrics like turnaround time and waiting time for different scheduling policies.

Uploaded by

Kashish Goel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment 1

CSE-4A
CPU Scheduling
Deadline: - 13-02-2019

1. Given a system with n processes, how many possible ways those processes are scheduled?
2. Differentiate process and thread. Describe all the entries of process control block.
3. Describe the differences among short term, medium term & long term scheduling.
4. Describe the actions a kernel takes to context switch between processes.
5. Write the syntax and explain the use of following system calls:
Fork, exec, wait, exit
6. Why context switching time should be minimum? How it is dependent on hardware support?
7. What will happen when system call is encountered in a user program?
8. What is the main advantage of multiprogramming?
9. Differentiate the APIs and System calls role in OS with suitable example.
10. Write a program in ‘C’ (Linux OS) in which the child process sends the name of one of the
existing file on disk to the parent process and the parent process displays the contents of that file.
The communication between the parent and the child is through pipe
11. What is the significance of kernel and user mode in OS? Explain with suitable example
12. What are the advantages of Virtual Machine?
13. Write a program in ‘C’ (Linux OS) which displays numbers from 1 to 10 and alphabets from A to
E alternately ( 1 2 A 3 4 B …. ). The program should have two threads (pthreads), One of the
thread displays numbers and other one displays alphabets. (Hint : Use sleep())
14. What is the main advantage of microkernel approach to system design? How do user programs
and system services interact in microkernel architecture? What are the disadvantages of using
microkernel approach?
15. Write down the differences between
a. User Thread and Kernel Thread
b. Fork () function and clone () function
c. CPU burst and I/O burst
16. Explain operating system and importance?
17. Write a program in ‘C’ (Linux OS) in which a parent forks a child and child forks a grandchild. The
program should display the output as “My process ID is A, my parent’s ID is B and my grandfather’s
ID is C”, where A, B and C are the process ID’s.
18. Write a program in ‘C’ (Linux OS) in which the parent process sends the length and breadth of a rectangle
and child process computes the area of rectangle. The communication between the parent and the child is
through pipe.
19. Write down a short note on Process Explore tool for Windows.
20. What resources are used when a thread is created? How do they differ from those used when a
process is created?
21. Write down a program to create two child processes and print following sequence by them
Child 1: - 2 4 8 16 32 64
Child 2: - 2 5 8 11 14 17

22. For processes listed in table, draw a chart illustrating their execution using
(a) FCFS
(b) SJF and Preemptive SJF (Shortest Remaining time first)
(c) RR (TQ-2)
(d) RR(TQ-1)
Also calculate average turnaround time, average wait time and average waiting time for each
algorithm.

Process Arrival Time Processing


Time
A 0 3
B 1.001 6
C 4.001 4
D 6.001 2

23. For the process listed in table below, draw a chart illustrating their execution using preemptive
Non preemptive priority scheduling. A larger priority number has higher priority.

Process Arrival Time Burst Priority


A 0 4 3
B 1.0001 3 4
C 2.0001 3 6
D 3.0001 5 5

24. Consider the following set of processes, with the length of the CPU-burst time given in
milliseconds:

Process Burst Time Priority


P1 10 3
P2 1 1
P3 2 3
P4 1 4
P5 5 2

The processes are assumed to have arrived in the order P1, P2, P3, P4, P5, all at time 0.
a. Draw four Gantt charts illustrating the execution of these processes using FCFS, SJF, a
nonpreemptive priority (a smaller priority number implies a higher priority), and RR
(quantum = 1) scheduling.
b. What is the turnaround time of each process for each of the scheduling algorithms in part a?
c. What is the waiting time of each process for each of the scheduling algorithms in parta?
d. Which of the schedules in part a results in the minimal average waiting time (over all processes)?
25. Consider the following set of processes, with the length of the CPU-burst time given in
Milliseconds:
Arrival time Burst Time Priority Process Type
P1 0 7 1 System
P2 3 8 2 Interactive
P3 5 2 1 System
P4 9 12 5 System
P5 0 2 2 Interactive
P6 2 3 1 Others

Schedule the above process as per following algorithm and find the Average waiting and TAT time.

a. Multi-level queue
System Queue – P-SJF
Interactive – RR-2
Others –FCFS

b. Multi-level feedback queue


Q1 RR-4
Q2 P-SJF
Q3 FCFS

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy