CS604 Midterm Solved Subjective with References by Hina
- Type
- Midterm past paper
- Course
- CS604 Operating Systems
- Size
- PDF 364 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 12. Download the file for all 12 pages.
Q1. List and define the different metrics by which might evaluate a scheduler (List at least 4). 5 marks
Answer: handouts Page No. 80 When evaluating a scheduler’s performance, utilization and Throughput are traded off for better Response Time. Response time is important for OS’s that aim to be user-friendly.
List of Schedulers include:
- First-Come, First-Served (FCFS)
- Round-Robin (RR)
- Shortest-Job-First (SJF)
- Priority Scheduling (PS)
Q2. Write brief the multilevel feedback queue scheduling. 5 marks
Answer: handouts Page No. 89 Multilevel feedback queue scheduling allows a process to move between queues. The idea is to separate processes with different CPU burst characteristics. If a process uses too much CPU time, it will be moved to a lower-priority queue. This scheme leaves I/O bound and interactive processes in the higher-priority queues. Similarly a process that waits too long in a lower-priority queue may be moved o a higher priority queue. This form of aging prevents
In general, a multi-level feedback queue scheduler is defined by the following parameters: Number of queues Scheduling algorithm for each queue Method used to determine when to upgrade a process to higher priority queue Method used to determine when to demote a process Method used to determine which queue a process enters when it needs service
Q3. Assumption made while formulating a solution to the critical section problem. 2 marks
Answer: handouts Page No. 98 A solution to the critical section problem must satisfy the following three requirements: Assumptions made While formulating a solution, we must keep the following assumptions in mind: Assume that each process executes at a nonzero speed No assumption can be made regarding the relative speeds of the N processes.
Q4. There are many commands. Write the method through which these commands can communicate with each other. 3 marks
Answer: handouts Page No. 27 There are many commands some of these are given below:- $ pw
Details
You can display the absolute pathname of your working directory with the pwd command
Syntax
/home/students/nadeem/courses/cs604/programs
cp
Details
You can use the cp command for copying files. You can use the cp file1 file2 command to copy file1 to file2.
Syntax
cp ~/file1 ~/memos/file2
mv
Details
You can use the mv command for moving files. You can use the mv file1 file2 command to move file1 to file2.
Syntax
$ mv ~/file1 ~/memos/file2
rm
Details
You can use the rm command to remove files. You can use the rm file1 command to remove file1
Syntax
$ rm ~/courses/cs604/programs/test.c $ For single file rm *.o For all files
Q5. Write Difference between SJF and Shortest Remaining Time First Scheduling algorithm. 3 marks
Answer: handouts Page No. 82 Shorted Job First (SJF) Scheduling Shortest Remaining Time First Scheduling For long term scheduling in a batch system, we can use as the length the process time limit that a user specifies when he submits the job Whenever a new job comes in, check the remaining service time on the current job. Preemptive SJF scheduling is sometimes called shortest-remaining-time-first scheduling. For all but the longest jobs, SRT better than SJF The response ratio is good (Fast) The response ratio is good (low) Waiting time is fast Waiting time is also quite low for most processes
Q6. Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job First scheduling
Answer: handouts Page No. 83 Preemptive SJF scheduling is sometimes called shortest-remaining-time-first scheduling. We illustrate the working of the SJF algorithm by using the following system state. Process Arrival Time Burst Time P1
- 0
P2
- 0
P3
- 0
P4
- 0
Qno7.
Define race condition and how prevent this condition. 2 marks
Answer: handouts Page No. 97 A situation like this, where several processes access and manipulate the same data concurrently and the outcome of the manipulation depends on the particular order in which the access takes place, is called a race condition.
Q8. What is Convoy Effect?
Answer: handouts Page No. 82 When FCFS scheduling algorithm is used, the convoy effect occurs when short Processes wait behind a long process to use the CPU and enter the ready queue in a Convoy after completing their I/O.
Q9. What are the common data structures in Bakery Algorithm?
Answer: handouts Page No. 103
Q10. How a pipe can be created?
Answer: handouts Page No. 103 The pipe() system call creates a pipe and returns two file descriptors, one for reading and second for writing,
Q11. Difference between “progress” and “ bounded time: in critical section
Answer: handouts Page No. 99
Process:
If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are not executing in their remainder section can participate in the decision on which will enter its critical section next, and this selection cannot be postponed indefinitely.
There exists a bound on the number of times that other processes are allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.
Q12. What is Starvation and how it occures
Answer: handouts Page No. 129
A process that is ready to run but lacking the CPU can be considered blocked-waiting for the CPU.
How it occur:-
If a deadlock occurs, it can be resolved if one car backs up (preempt resources and rollback). Several cars may have to be backed up if a deadlock occurs. Starvation is possible.
Q13. What are the advantages of Round Robin Scheduling Algorithm?
Answer: handouts Page No. 86 If time slice is too short then you will have freq switching btw processes. If time slice is too long then you will have less switching btw processes and high priority may have to wait for low priority tasks leading to starvation. The average waiting time under the RR policy however is often quite long. The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum. The process may have a CPU burst of less than 1 time quantum, in which case the process itself will release the CPU voluntarily. It is the simplest scheduling algorithm. It is easy to implement in software. If the processes are of varied length then it becomes slow.
Q14. Analyze the following algorithm to solve the critical section problem and explain whether it satisfies the Mutual Exclusion Characteristic
Related CS604 files
All CS604 files →- CS604 Midterm Solved Subjective with References by Umair Saulat Midterm DOC 162 KB
- CS604 Midterm Solved Subjective with References by Moaaz Midterm PDF 1.1 MB
- CS604 Midterm Subjective by Waqar Siddhu Midterm PDF 1.5 MB
- CS604 Midterm MCQs Set 2 by Waqar Siddhu Midterm PDF 8 MB
- CS604 Highlighted Handouts Set 2 Highlighted PDF 4.2 MB
- CS604 Midterm Current Quiz by Danish Hanif Quiz PDF 2.6 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.