CS604 Midterm Solved Subjective with References by Moaaz
- Type
- Midterm past paper
- Course
- CS604 Operating Systems
- Size
- PDF 1.1 MB
- 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 10. Download the file for all 10 pages.
Explain if the given code satisfies Mutual Exclusion or not. Justify your answer. (5)
Answer: (Page 105) No, it does not satisfy Mutual Exclusion because too prove mutual exclusion, note that Pi enters its critical section only if either flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0 and P1 could not have found both conditions in the while statement true at the same time, since the value of ‘turn’ can either be 0 or 1. Hence only one process say P0 must have successfully exited the while statement. Hence mutual exclusion is preserved.
3. write down the software based solution for critical section problem (2)
Answer: (Page 101)
do
Entry section
Exit section
} while(1)
5. while working on linux, by which command you can show information about a process (2)
Answer: (Page 66) ps gives a snapshot of the current processes. Without options, ps prints information about processes owned by the user.
Fall 2012
Q1. Difference between “progress” and “ bounded time: in critical section. (2 marks)
Answer: (Page 98) Progress:-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.
Bounded Waiting:- 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.
Q3. If process in background then we want its move in foreground then what unix linux command is use to moving. (3 marks)
Answer: (Page 65)
Moving a process into foreground
You can use the fg command to resume the execution of a suspended job in the foreground or move a background job into the foreground. Here is the syntax of the command. fg [%job_id] Where, job_id is the job ID (not process ID) of the suspended or background process. If %job_id is omitted, the current job is assumed.
Q4. How The open source help us to test the algorithm (3 marks)
Answer: (Page 94) The Open Source software licensing has made it possible for us to test various algorithms by implementing them in the Linux kernel and measuring their true performance.
Answer: Rep
Fall 2012
Q1. Preemptive Short Job First scheduling algorithm is best algorithm for minimizing the waiting time for the process. How can you calculate the average time in preemptive Short Job First scheduling algorithm?
Answer: (Page 80)
Related CS604 files
All CS604 files →- CS604 Midterm MCQs Set 2 by Waqar Siddhu Midterm PDF 8 MB
- CS604 Midterm Solved File 3 by Team Hadi Midterm PDF 3.5 MB
- CS604 Midterm Solved MCQs with References by Moaaz Midterm PDF 2 MB
- CS604 Final Term Solved Subjective with References by Moaaz Final term PDF 1.1 MB
- CS604 Highlighted Handouts Highlighted PDF 4.4 MB
- CS604 Quiz 1 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.