Que Stio N No Type (MC Q/SAT) CO Mapp Ing Answer Key
Que Stio N No Type (MC Q/SAT) CO Mapp Ing Answer Key
Que Stio N No Type (MC Q/SAT) CO Mapp Ing Answer Key
(a) 16 kb
(b) 15 kb
(c) 14 kb
(d) 17 kb
Consider the following page reference CO5 a
string: 7, 6, 5, 4. 7, 6, 8, 7, 6, 5, 4, 8. If
MRU (most recently used) page
replacement technique is used, then
what will be the difference of page
faults in case of memory with 4 and 3
frames are used respectively. Assume
initially, frames are empty.
(a) 0
(b) 1
(c) 2
(d) 3
Q. If a CPU generates address 00f2 and CO5 a
No: re-locatable register contains ff22
3 then what will be the physical
address?
(a) 10014
(b) 10024
(c) fc224
(d) ff243
Which of the following is false in CO3 b
context of inter process
communication?
(a) communicate with each other
(b) share same address space
(c) synchronize their actions
(d) passing message with each other
CO5 b
(a) 8
(b) 7
(c) 10
(d) 13
Suppose the to service a page fault is CO5 c
on average 20 ms, while a memory
access takes 10 micro seconds. Then
80% hit ratio results in avg. memory
access time of
(a) 3008 micro sec.
(b) 5004 micro sec.
(c) 4008 micro sec.
(d) 2008 micro sec.
Q. If time span size is 3 unit of time and CO3 a
No: only one process with 16 burst time is
4 there in ready queue, then we apply R-
R CPU scheduling algorithm. What
will be the number of context switch?
(a) 5
(b) 6
(c) 4
(d) 7
A process executes the following CO1 d
segment of code: for(i=1; i<=n; i++)
fork(); The number of new processes
created is:
(a) n(n+1)/2
(b) n
(c) 3^n-1
(d) 2^n-1
Consider the following statements: CO2 d
S1: CPU is a non preemptive resource
S2: I/O device is preemptible
Which of the above statements is/are
true?
(a) S1
(b) S2
(c) both are true
(d) none of these
A company has hired you to design CO5 a
the virtual memory system for their
new line of desktop computers. Each
computer will have 32 bits virtual and
physical addresses, and memory will
be allocated in pages of size 2KB. How
much physical memory is required to
store the page table?
(a) 2MB
(b) 4MB
(c) 6 MB
(d) 3 MB
Q. Consider 4 processes sharing the CPU CO3 b
No: in a round-robin fashion. Assuming
5 that each process switch takes 1
second, what must be the quantum
size q such that the overhead resulting
from process switching is minimized
but at the same time each process is
guaranteed to get its turn at the CPU
at least every 10 seconds?
(a) 3
(b) 2
(c) 1
(d) 4
Consider the following cooperating CO4 d
processes p1 and p2 using shared
variable i = 11
Method Used by P1
begin
A
i++;
printf(“%d”,i);
end
Method Used by P2
begin
printf(“%d”,i);
B
end
Write the code for A and B so that
output will be 9 10.
(a) S = 0, A: Signal(S), B: Wait(S)
(b) S= 1, A: Signal(S), B: Wait(S)
(c) S = 0/1, A: Signal(S), B: Wait(S)
(d) none of these
A counting semaphore has a value of CO4 a
(-8) in a certain period. So, what is the
number of waiting process (es)?
(a) 8
(b) 7
(c) 9
(d) none
At a particular time of computation CO4 a
the value of a counting semaphore is
7.Then 20 P operations and 14 V
operations were completed on this
semaphore. The resulting value of the
semaphore is?
(a) 1
(b) 3
(c) 2
(d) None
Q. A system uses FIFO policy for page CO6 d
No: replacement. It has 5 page frames
6 with no pages loaded to begin with.
The system first accesses 100 distinct
pages in some order and then access
the same 100 pages but now in the
reverse order. How many page faults
will occur?
(a) 180
(b) 190
(c) 200
(d) none
A system has 3 co-operating processes CO4 b
sharing a resource with 4 instances. If
each process needs maximum 2
instances, then deadlock will occur or
not?
(a) yes
(b) no
(c) can’t say
Suppose, s is a Semaphore with the CO3 c
initial value of 2. There are four active
processes A, B, C and D are executing
in the following order: A: P(s), B: P(s),
C: V(s), D: P(s), C: P(s). At the end
how many processes will be blocked?
(a) 0
(b) 2
(c) 1
(d) none
medium term scheduler taken place CO1 e
(a) between ready state and execution
state
(b) between start state and ready state
(c) between execution state and
termination state
(d) between execution state and
waiting state
(e) none of these
Q. CO1 c and d
No:
7
Questio Question CO
n No Mappi
ng
Where, X = Roll no % 6
(a) Check that the aforementioned system can reach in safe
state or not? If it is in safe state, then what is the safe
sequence?
(b) If P4 requests (0 1 0 1) resources, then it can be granted or
not?
Where, X = Roll no % 6
(a) For which value of Y, the aforementioned system can reach
in safe state? What is the safe sequence?
(b) If P4 requests (0 1 0 1) resources, then it can be granted or
not?
Ans: (6marks)
(b) (6 marks)
(a) A system is having ‘N’ user processes. Each requires 4 unit
of resource ‘R’. What is the minimum number of units of ‘R’
such that no deadlock occurs? N = right most significant digit
of your Roll No.( ex:- for Roll No. 180854, N=4) (5
marks)
Ans: X=4
Then, X will be 1
Ans: Selected cpu scheduling algo will be SJF and SRTF. (need
explanation)
Q.No:9 Consider process arrival as given below where N = right most CO3,
significant digit of your Roll No.( ex:- for Roll No. 180854, CO4
N=4):
Ans:
Data to be finalized by finding the value of N for each Roll No
Preemptive Priority Scheduling(6 Marks)
Round Robin(6 Marks)
Waiting Time:(2marks)
The arrival time and duration of the CPU and I/O bursts for
each of the three processes A, B, and C are given in the table
below. Each process has a CPU burst followed by an I/O burst
followed by another CPU burst. Assume that each process has
its own I/O resource.
Process Arrival CPU I/O burst CPU
time burst burst
P1 0 1 4 Roll no %
5
P2 2 3 3 1
P3 3 1 3 1
Solution:
Consider process arrival as given below where N = right most
significant digit of your Roll No.( ex:- for Roll No. 180854,
N=4):
Waiting Time:(2marks)
Ans: i) a. if the outcome of the dice is 6, then all the other players must
wait.
b. if the outcome of the dice is other than 6, then immediate next player
gets access of the dice and other players must wait.
ii) Binary semaphore s for ensuring access of the dice and initial value is
1 i.e., available
Counting semaphores p[0] = 1, p[1]=p[2]=p[3]=0 ensure that which process
will get access of dice next.
iii)
while(true)
¿
First list the semaphores that you will use and their initial
values (don’t worry about who creates and initializes them).
Then show the code for Barrier( ) that uses the semaphores
declared by making P/Wait and V/Signal calls on them.(12
marks)
Solution:
struct barrier_type
// initialize to 0
int arrive_counter;
// initialize to p
int leave_counter;
int flag;
std::mutex lock;
};
b->lock.lock();
if (b->arrive_counter == 0)
b->lock.unlock();
b->lock.lock();
b->flag = 0; // first arriver clears flag
b->arrive_counter++;
b->arrive_counter = 0;
b->leave_counter = 0;
b->flag = 1;
b->lock.unlock();
b->lock.lock();
b->leave_counter++;
b->lock.unlock();
In a civilized society, a gentle man lives with his spouse and his
elderly parents. Due to old age, his parents cannot be left alone
in the house. So, at least any one of the spouse must be
available in the house. Write a synchronize solution using
semaphore for this problem. (12 marks)
spouse_work(i)
{
while(1)
{
enter_house(i);
takecare_parent();
leave_house(i);
}
}
enter_house(i)
{
p(mutex)
spouse_state[i]=in;
check_spouse_status((i+1)%2);
v(mutex)
}
check_spouse_status(i)
{
if(spouse_state[(i+1)%2] == in && spouse_state[i] ==
desire_out)
{
spouse_state[i] = out;
v(spouse[i])
}
}
leave_house(i)
{
p(mutex)
spouse_state[i] == desire_out;
check_spouse_status(i);
v(mutex)
p(spouse[i])
}
Q.No:11 (a) Why SJF and SRTF cannot be applied in real world CO3,
solution? What is the solution for that? – discuss briefly CO4,CO
(marks 3) 5, CO6
(6 marks)
Solution:
Consider Roll No. 20054263%8=7
The partitions are 4k,7k,20k,2k, now due to the best-fit algorithm,
Segmentation
Ans: Size of a page is 8K. So, from the 64 bit VA, 13 bits are
going to be used for the offset. 64 – 13 = 51 bits can be used for
the page number. So, a conventional page table might contain
up to 2^51 PTEs.
(c)
Where x = roll no % 9 (marks 6)
Solution:
Segmentation
Paging is more close to the Operating system rather than the User. It
divides all the processes into the form of pages regardless of the fact that a
process can have some relative parts of functions which need to be loaded
in the same page.
The details about each segment are stored in a table called a segment
table. Segment table is stored in one (or many) of the segments.
Segment table contains mainly two information about segment: