total Qs 26.
20 MCQs.
2Qs of 2 marks.
2Qs of 3 marks.
2Qs of 5 marks.
Limited Register contains the size of the process.
Command-line interpreter is also called shell in some operating system.
You can use the cp file1 file2 command to copy file1 to file2.
IO bound process spend more time doing IO thancomputation.
Pipes are used for communication between relatedprocesses on a system.
----------------------------------------------------------------------
What are pros and cons of multithreading?5 marks --------p-70
What is waiting time in context of CPU burst?2marks
Waiting time: Waiting time is the time spent waiting in the ready queue. We want to
minimize the waiting time to increase CPU efficiency.
Prove that SJF is an optimal scheduling?3marks--------------p-85
Q. What is the main disadvantage od semaphore?5marks----------p-110
Q. About spinlock..3marks
===========================================================
20 MCQ's and 6 questions
1. Write data structures for bakery algorithm? (2 marks)
The common data structures are:
boolean choosing [n];
int number[n];
Initially these data structures are initialized to false and 0, respectively. The following
notation is defined for convenience:
Æ’ (ticket #, process id #)
Æ’ (a,b) < (c,d) if a<c or if a= =c and b<d.
Æ’ max(a0, …an-1 ) is a number, k, such that k>= ai for i=0,…n-1
2. Which command is used for suspending a foreground process? (2 marks)
You can suspend a foreground process by pressing <Ctrl-Z>, which sends a
STOP/SUSPEND signal to the process
3. Which command is used to resume the execution of a suspended job in
the background? (3 marks)
You can use the bg command to put the current or a suspended process into the background. Here is the syntax of the command.
bg [%job_id]
If %job_id is omitted the current job is assumed.
4. Define race condition? (3 marks)
A situation, where several processes access and manipulate the same data
concurrently and the outcome of the manipulation depends on the particular order in which the access takes place, is called a race condition.
5. How to implement RR scheduling? (5 marks)
To implement RR scheduling, we keep ready queue as a FIFO queue of processes. New processes are added to the tail of the ready queue. The CPU scheduler picks the first process from the ready queue, sets a timer to interrupt after 1 time quantum, and then dispatches the process. One of the two things will then happen. The process may have a CPU burst of less than 1 time quantum, in which case the process itself will release the CPU voluntarily. The scheduler will then proceed to the next process in the ready queue.
Otherwise, if the CPU burst of currently running process is longer than one time quantum, the timer will go off and will cause an interrupt to the operating system. A context switch will happen, the current process will be put at the tail of the ready queue, and the newly scheduled process will be given the CPU.
6. Highlight critical sections of this code? (5 marks)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1
=====================================================================
Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a scheduler (List at least 4). 5 marks
2. Write brief the multilevel feedback queue scheduling. 5 marks---p-89
3. Assumption made while formulating a solution to the critical section problem. 2 marks
While formulating a solution, we must keep the following assumptions in mind:
Æ’ Assume that each process executes at a nonzero speed
Æ’ No assumption can be made regarding the relative speeds of the N processes.
4. There are many commands. Write the method through which these commands can communicate with each other. 3 marks
5. Write Difference between SJF and Shortest Remaining Time First Scheduling algorithm. 3 marks
Sjf algorithm is associated with each process the length of the next latter’s cpu brust. When the cpu is available, it is assigned to the process that has the smallest next cpu brust.
While in srtf scheduling algorithm preempts the currently executing process, wheres a non-preemptive sjf algorithm will allow the coureently raunning process to finish its cpu brust.
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2 marks
Average waiting time: (0+24+27)/3 = 17
7. Define race condition and how prevent this condition. 2 marks
A situation, in which many process access and manipulate the same data concurrently and the outcomes of the manipulation depends on the particular order in which the access takes place, is called race condition. To prevent this condition we required synchronization of the process.