CS604 VU Current Assignment No. 3 Spring 2012 Solution

CS604 VU Current Assignment No. 3 Spring 2012 – Solution Soon

Assignment No. 03
SEMESTER SPRING 2012
CS604- Operating System

Total Marks: 20
Due Date: 1st June 2012

Assignemnt:

Question 1:
There are six processes given below with their run time units. Assume that all processes arrive in numerical order at time 0 then answer the questions given below:

Process ID CPU Requirements
P1 …………..5
P2 …………..4
P3 …………..7
P4 …………..1
P5 …………..8
P6 …………..10

Show the scheduling order for these processes under first-come-first-served, shortest-job first, and roundrobin scheduling (quantum = 4).

Question 2:

There are two processes that could take place even at the same time. One process helps in getting amount from the ATM and the second helps in depositing the money in the bank account through a cheque. You ensure mutual exclusiveness by using semaphore with wait and signal operations. Write pseudo-code or algorithm for these two processes.

Uploading Instructions:

Upload your assignment as a word file. It should have name [YourRollNo.doc]

Deadline
Your assignment must be uploaded/submitted at or before 1st June 2012

Solution:

olution first question
FCFS = p1,p2,p3,p4,p5,p6

SJF = p4,p2,p1,p3,p5,p6

round robin = p1,p2,p3,p4,p5,p6,p1,p3,p5,p6,p6
do
{
…………….
Deposit money in nextp
…………..
Wait (getting);
Wait(mutex);
………….
Deposit nextp to ATM
………
Signal(mutex);
Signal(deposit);
}
While(1);
Code for getting money process
do
{
Wait (deposit);
Wait(mutex);
………….
get money from ATM to nextc
………
Signal(mutex);
Signal(getting);
Get the money in nextc
………….
}
While(1);

Related Posts Plugin for WordPress, Blogger...

Leave a Reply