Ads Top

Solved Mid Term Paper CS703 (Advance Operating Systems ) Part-3

Paper 1

Q 1. how thread in created and sometime a thread may not created why? 5 marks
Q 2. Differentiate preemptive and non preemptive scheduling algorithms and give example of each. 5 marks.
Q.3. How implicit and explicit memory allocator work 5 marks.
Q 4. if size of header and footer is 4 byte word and no zero payload is allowed tell the minimum size block for each 
Assignment Header/ footer free word 
single word both Header footer free word =
single word only header free word =
double word both header footer free word =
double word only header free word =
10 marks
last one I dont know how to do.
and 10 mcq of one mark each

Paper 2

10 MCQs
Q 1. In your opinion what can be the ways that make it possible that the process should not enter in critical section simultaneously and fulfill critical section requirement in such a way that no need to code for it explicitly.
Q 2. Describe the working of explicit and implicit memory allocators 
Q 3. Suppose that a system is in an unsafe state. Show that that is possible for the process to completed their execution without entering a deadlock state.
Q 4. What is the algorithmic order of the worst case allocation time and worst case freeing times of the following dynamic memory allocation techniques?
a. Implicit free lists
b. Explicit free list (with coalescing while freeing)
c. Simple segregated free lists (without coalescing while freeing).

Paper 3

MCQ ------10 marks
1. In top down view, all services are involved & accomplish through -------calls
a) System Data Process Memory
2. If any parent terminates without repearing child then child will be repeat by ------process
a) Fork
b) Init
c) .dll
d) .rp
3. Explicit reaping is only required form----running process
a) Short Medium Long All
4. If two threads are waiting for lock & both see its ----only one grab it
a) Under process Free
b) Address space Namespace
5. A queue of threads are waiting for something inside a critical region is called
a) Local variable Global variable
b) Semaphore Condition variable
6. ------scheduling assign priorities to tasks on basis of periods
a) Time Monotonic Period monotonic
b) Time Period
7. Function is called ---- if and only if it access no shared variables when called from multiple threads
a) Atomic Safe Unsafe Reentrant
8. Condition variables are not cumulative that’s why they must be in a
a) Critical section
b) Monitor
c) Semaphore
d) Mutex
9. In ----architecture of process assignment ,key kernel function always run on particular process
a) Kernel level
b) Master/slave
c) Peer
d) Global
10. User -----can create lots of kernel work i.e may network packets come in that OS has to process when doing a read or write system call
a) Process
b) Thread
c) Input
d) Output
Kernel provides basic primitives e.g. transport of messages, loading programs into memory, device handling. Policy decisions are made in the user space while mechanisms are implemented in ________.
1. Micro-kernel
2. Registers
3. Space
4. Memory
In _________ of process assignment, operating system can execute on any processor and each processor does self-scheduling.
1. Global Queue
2. Master/slave
3. Peer Architecture
4. Kernel level
________fragmentation occurs when there is enough aggregate heap memory, but no single free block is large enough.
1. External
2. Internal
3. Memory
4. Heap
A non-process kernel execute kernel outside of any _______.
(a) Address Space
(b) Module
(c) Event
(d) Process
Explicit reaping is only required form----running process
a Short 
b Medium 
c Long 
d All
------scheduling assign priorities to tasks on basis of periods
a) Time Monotonic 
b) Period monotonic
c) Time 
d) Period
The rate-monotonic scheduling algorithm uses pre-emptive scheduling with static priorities. Priorities are assigned inversely to the period of each task, giving higher ( better ) priority to tasks with shorter periods.
1.Non-process Kernel Execute kernel outside of any (process)
2.Interrupts Caused by events external to the( processor)
3.A progress graph depicts the (discrete) execution state space of concurrent threads
4.A (semaphore) is a variable that is manipulated atomically through two operations, signal and wait
5.When semaphores are used for mutual exclusion, the semaphore has an initial value of 1, {V()} is called after the critical section
6.(STCF) run whatever job has least amount of stuff to do
7.The system will not interrupt a (SCHED_FIFO) thread if Another FIFO thread of higher priority becomes ready
8.dynamic memory ki aik mcq thaa
9.(Explicit:) application allocates and frees space
10.load sharing thee i think.

Paper 4

Three processes are sharing 4 resources of same type in system. Every process need 2 resources show system is deadlock free.
Why it is considered that threads are harmful?
In lectures, we studied that there are three methods possible to achieve concurrency. What is the difference between second (Single Process, multiple events) and third (threads) method?
Difficulties with designing system software?


Paper 5

1)      20 MCQs
2)      Consider a variant of round robin where the entries in the ready queue are pointer to the PCB.
a)      What would be the effect of putting two pointers to the same process in the ready queue?
b)      What would be the major advantage and disadvantage of this scheme?
c)      How would you modify the basic RR algorithm to achieve the same effect without the duplicate pointers?
Answer:
a. In effect, that process will have increased its priority since by getting time more often it is receiving preferential treatment.
b. The advantage is that more important jobs could be given more time, in other words, higher priority in treatment. The consequence, of course, is that shorter jobs will suffer.
c. Allot a longer amount of time to processes deserving higher priority. In other words, have two or more quantums possible in the Round-Robin scheme.

Bounded buffer monitor program
Write a bounded-buffer monitor in which the buffers (portions) are embedded
within the monitor itself.
Answer:
monitor bounded_buffer {
int items[MAX_ITEMS];
int numItems = 0;
condition full, empty;
void produce(int v) {
while (numItems == MAX_ITEMS)
full.wait();
items[numItems++] = v;
empty.signal();
}
int consume() {
int retVal;
while (numItems == 0)
empty.wait();
retVal = items[--numItems];
full.signal();
return retVal;
}
}



Three processes are sharing 4 resources of same type in system. Every process need 2 resources show system is deadlock free.
solution
If the system is deadlocked, it implies that each process is holding one resource and is waiting for one more. Since there are 3 processes and 4 resources, one process must be able to obtain two resources. This process requires no more resources and therefore it will return its resources when done.

Multithread solution on multiple kernel thread gives better performance than single thread solution on single process system. Under what condition this occurs.

Answer:
When a kernel thread suffers a page fault, another kernel thread can be switched in to use the interleaving time in a useful manner. A single-threaded process, on the other hand, will not be capable of performing useful work when a page fault takes place. Therefore, in scenarios where a program might suffer from frequent page faults or has to wait for other system events, a multi-threaded solution would perform better even on a single-processor system.

Micro kernel advantages and disadvantages
Answer:
 Benefits typically include the following
(a) adding a new service does not require modifying the kernel,
(b) it is more secure as more operations are done in user mode than in kernel mode, and
(c) a simpler kernel design and functionality typically results in a more reliable operating system.

The primary disadvantage of the microkernel architecture are the overheads associated with interprocess communication and the frequent use of the operating system’s messaging functions in order to enable the user process and the system service to interact with each other.




Consider the following processes and their related information:
Calculate response time, Waiting Time, and turnaround time and draw the Gant charts for FCFS, Priority, and RR and Shortest job first.
 Time quantum for RR is 1

Paper 6
1. In top down view, all services are involved & accomplish through -------calls
a) System Data Process Memory
2. If any parent terminates without repearing child then child will be repeat by ------process
a) Fork
b) Init
c) .dll
d) .rp
3. Explicit reaping is only required form----running process
a) Short  Medium  Long  All
4. If two threads are waiting for lock & both see its ----only one grab it
a) Under process Free
b) Address space   Namespace
5. A queue of threads are waiting for something inside a critical region is called
a) Local variable Global variable
b) Semaphore Condition variable
6. ------scheduling assign priorities to tasks on basis of periods
a) Time Monotonic       Period monotonic
b) Time Period
7. Function is called ---- if and only if it access no shared variables when called from multiple threads
a) Atomic Safe Unsafe Reentrant
8. Condition variables are not cumulative that’s why they must be in a
a) Critical section
b) Monitor
c) Semaphore
d) Mutex
9. In ----architecture of process assignment ,key kernel function always run on particular process
a) Kernel level
b) Master/slave
c) Peer
d) Global
10. User -----can create lots of kernel work i.e may network packets come in that OS has to process when doing a read or write system call
a) Process
b) Thread
c) Input
d) Output
Kernel provides basic primitives e.g. transport of messages, loading programs into memory, device handling. Policy decisions are made in the user space while mechanisms are implemented in ________.
1. Micro-kernel
2. Registers
3. Space
4. Memory
In _________ of process assignment, operating system can execute on any processor and each processor does self-scheduling.
1. Global Queue
2. Master/slave
3. Peer Architecture
4. Kernel level
________fragmentation occurs when there is enough aggregate heap memory, but no single free block is large enough.
1. External
2. Internal
3. Memory
4. Heap
A non-process kernel execute kernel outside of any _______.
(a) Address Space
(b) Module
(c) Event
(d) Process
Explicit reaping is only required form----running process
a Short 
b Medium 
c Long 
d All
------scheduling assign priorities to tasks on basis of periods
a) Time Monotonic 
b) Period monotonic
c) Time 
d) Period
The rate-monotonic scheduling algorithm uses pre-emptive scheduling with static priorities. Priorities are assigned inversely to the period of each task, giving higher ( better ) priority to tasks with shorter periods.
1.Non-process Kernel Execute kernel outside of any (process)
2.Interrupts Caused by events external to the( processor)
3.A progress graph depicts the (discrete) execution state space of concurrent threads
4.A (semaphore) is a variable that is manipulated atomically through two operations, signal and wait
5.When semaphores are used for mutual exclusion, the semaphore has an initial value of 1, {V()} is called after the critical section
6.(STCF) run whatever job has least amount of stuff to do
7.The system will not interrupt a (SCHED_FIFO) thread if Another FIFO thread of higher priority becomes ready
.(Explicit:) application allocates and frees space

No comments:

Powered by Blogger.