Software q Ns

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

#01.

(a) Define the following:


- Operating System & three main purpose of operating system
- Thread & five benefits of threads over processes
- Deadlock & four conditions for deadlock to happen
- Virtual machine
(b) Distinguish between:
- critical section & critical resource
- Kernel & OS
- Multiprogramming systems, Multitasking systems & Multiprocessor systems
(c) Define action taken by Kernel to context switch:
- Among thread
- Among process
#02. (a) (i) What is Deadlock ?
(ii) Why deadlock is more critical than Starvation?
(b) Suppose the following processes, proc1 and proc2 are executed concurrently and share the
semaphore variable S and R (each initialized to 1) an integer variable x (initialized to 0)

void proc1() { void proc2() {


do { do {
semWait(S); semWait(R);
semWait(R); semWait(S);
x ++; x --;
semSignal(S); semSignal(S);
SemSignal(R); SemSignal(R);
} while(1); } while(1);
} }

Can the concurrent execution of these two processes results in one or both being blocked forever
(deadlocked)? If yes, give execution sequence.
(c) Consider the following scenario of system with four processes P1, P2, P3 and P4 and two resources
R1 and R2 respectively, each resource has two instances. Futhermore:
- P1 holds an instance of R2, and requests an instance of R1;
- P2 holds an instance of R1, and doesn’t need any other resource;
- P3 holds an instance of R1 and require an instance of R2;
- P4 holds an instance of R2 and doesn’t need any other resource;
(i) Draw the resource allocation graph
(ii) Is the system in deadlock ? If yes, explain why. If not, give any sequence of execution for every
process to complete

#03. (a) Define: (i) Scheduler (ii) Dispatcher (iii) Synchronization


(b) Distinguish between: (i) Process & Program (ii) Multiprogramming & Multiprocessing (iii)
Job scheduling & CPU scheduling (iv) Pre-emptive & Non-preemptive
(c) Criteria used to select time-quantum in round robin algorithm
(d) Consider the following set of processes, with the length of CPU burst in milliseconds.
Process P1 P2 P3 P4 P5
Arrival time 00 02 03 06 30
Burst time 10 12 14 16 05
(i) Draw Gantt chart that illustrate s the execution of these processes using preemptive
shortest job first (SJF) algorithm & find waiting time
(ii) Compute the turn around time
#04. (a) Explain the following disk scheduling algorithm with examples:
(i) SCAN (ii) LOOK (iii) SSTF
(b) Consider an imaginary disk with 51 cylinders. A request comes in to read a block on
cylinder 11. While the seek to cylinder 11 is in progress, new requests come in for cylinder s 1, 36, 16,
34, 9 and 12 in that order starting from the current head position, what is the total distance (in
cylinders) that disk arm moves to satisfy all pending request for LOOK disk scheduling algorithm?
(c) (i) There are 200 tracks on the disk platter and the pending requests are coming in that order
36, 69, 167, 76, 42, 51, 126, 12 and 199. Assume the arm is located at the 100th track and moving
towards 200th track. If sequence of disk access is 126, 167, 199, 12, 36, 42, 51, 69 and 76 then which
disk access scheduling policy is used ?
(ii) On the disk with 1000 cylinders (0-999) find the number of tracks the disk arm must
move to satisfy all requests in the disk queue. Assume the last request service was at track 345 and the
head is moving towards track 0. The queue in FIFO order contain request for the following tracks: 123,
874, 692, 475, 105, 376 (Assume SCAN algorithm)
#05. (a) (i) Define: Paging, Swapping & Segmentation
(ii) Differentiate between internal and external fragmentation
(iii) Assuming a 4-KB page size system, what is the page number and offset for the address
reference 9972 ?
(b) Given six available memory partitions in the order of 300KB, 500KB, 450KB, 200KB,
650KB and 125KB for the following processes with size of 150KB, 400KB, 360KB, 200KB and
110KB (in order):
(i) How would the best-fit algorithm place the above processes ?
(ii) Show how much internal fragmentation exists in the system
(c) Given three sub-routines of 500, 650 and 380 KB each. If paging is used, determine the total
amount of wasted memory due to internal fragmentation when the three sub-routines are loaded into
memory using each of the following page sizes:
(i) 200KB (ii) 450KB (iii) 750KB
#06. Concerning with File Systems (Questions are about definitions and short answers as presented on
lecture notes)

You might also like