Skip to content
VUBuddy

CS604 Midterm Solved Subjective with References by Moaaz

Operating Systems PDF 1.1 MBUpdated 23 Oct 2026
Midterm past paper CS604 Midterm Solved Subjective with References by Moaaz PDF 1.1 MB
vubuddy.com
Type
Midterm past paper
Course
CS604 Operating Systems
Size
PDF 1.1 MB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 1.1 MB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 10. Download the file for all 10 pages.

Solved Subjective · From Midterm Papers · 16 May,2013 · PSMD01 · Fall 2012 · The given code is as following; · boolean flag[2]; · int turn; · do · flag[i]=true; · turn=j; · while(flag[j] && turn==j); · flag[i]=false; · } while(1)

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.

Fall 2012 · what is difference b/w preemptive and non-preemptive (2) · difference b/w progress and bound waiting

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)

All CS604 files →
CS604 Operating Systems All CS604 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.