Professional Documents
Culture Documents
com
CS604 - Operating System - Question No: 22 ( M a r k s: 5 )
What are the advantages of Round Robin Scheduling Algorithm?
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Ans: To prove mutual exclusion, note that Pi enters its critical section only if either
flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at
the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0
and
P1 could not have found both conditions in the while statement true at the same time,
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must have
1.Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
: 5marks
2.List and define the different metrics by which we might evaluate a scheduler
(list at least 4)
5marks
3. How can you differentiate between a library call and a system call? Explain
briefly giving at least one example.
3marks
The library function executes the instruction following trap; interprets the return
values from the kernel and returns to the user process.
www.vustudents.ning.com
The operating system determines which system call is to be carried out by
examining one of the parameters (the call number) passed to it by library routine.
4. Define the terms "Bounded Waiting" and "Progress" with respect to Critical
Section Problem. (3 marks)
Bounded Waiting :
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
before that request is granted.
Progress :
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
this selection cannot be postponed indefinitely.
5. How can you differentiate between the fifo and pipe?(2 marks)
2 Questions of 2 marks:
1) What are the three requirements for the solution of critical
section problems
2) mkfifo() call may fail due to many reason. Describe the situations
in which mkfifo() command will terminate and also describe the
situations in which the mkfifo() command will not terminate
2 Questions of 5 marks:
1) What are the advantages of Round Ribon scheduling algorithm and
what are the disadvantages of this scheduling algorithm
2) Highlight the shortcoming in the following hardware solution
do
{
while(testandset(lock));
critical section
lock=false;
remainder section
}while(1);
www.vustudents.ning.com
__________ integer shows the highest priority of a process in CPU
scheduling.
1. Small
2. Large
1. interactive
2. Non-interactive
3. Fore ground
4. Preemptive
1. Non-preemptive scheduling
2. Preemptive scheduling
3. Dispatching scheduling
4. FCFS scheduling
The procedure “The time at which the process finished working MINUS the
arrival time of the process MINUS CPU burst for that process” will help
calculate the _________.
1. Kernel
2. User
First _______ entries in Per Process File Descriptor Table are used as soon
as the process is created.
1
2
3
4
www.vustudents.ning.com
_____________ is a preemptive scheduling algorithm.
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Taking the CPU from one process and giving the CPU to another process is termed
as
1. Context switching
2. Dispatching
3. Swapping
4. Tracking
Same
Different
Kernel threads
www.vustudents.ning.com
User level threads
ls
ps
gcc
cat
In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:
1. File
2. Screen
3. Printer
4. Scanner
5.
1. nice
2. cmd
3. cat
4. grep
ls
cs
top
www.vustudents.ning.com
cd
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
1. Little’s Formula
2. Deterministic Modeling
3. Queuing Theory
4. Queuing analysis
The process id returned to the child process after successful fork system call
execution is ______.
0
1
2
3
Priority
Weight
Time
Scheduling
In Unix/ Linux, by default the standard input file is attached to the ___________
Select correct option:
Mouse
Keyboard
Light pen
www.vustudents.ning.com
Joystick
Deadlock
Aging
Starvation
None of these
A solution to the critical section problem must satisfy the following three requirements:
Mutual Exclusion
Progress
Bounded Waiting
Non-preemptive SJF
Priority Scheduling
FCFS
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Round Robin algorithm is most suitable for __________.
Time sharing system
Real time systems and batch systems
Running Batch programs
Expert system
If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
1. Pipe
2. Read
3. Write
4. Open
_____ system call is used to write to a file or FIFO or any other IPC channel.
1. read
2. write
3. open
4. fork
1. Round Robin
2. First Come First Serve
3. Multilevel Feedback Queue
4. Shortest Remaining Time First
MIDTERM
EXAMINATION Spring
2010
CS604- Operating Systems (Session - 3)
Time: 60 min
Marks: 40
► Interrupt
► Signal
► Trap
► Process
►l
l
►s
► ls
► none of the given options
www.vustudents.ning.com
Question No: 3 ( Marks: 1 ) - Please choose one
The -------------- system call suspends the calling process.
► fork
► wait
► exec
► exit
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► ps
► top
► who
► ls
► fg
► bg
► jobs
► kill
► fg
► bg
► jobs
► kill
► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options
► Multi tasking
► Interactive
► All of these
► Multi user
► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability
www.vustudents.ning.com
Question No: 11 ( Marks: 1 ) - Please choose one
Shared libraries and kernel modules are stored in
directory
www.vustudents.ning.com
► /bin
► /dev
► /boot
► /lib
► Long term
► Short term
► Medium term
► Swapper
► do
► do not
► Semaphore
► Monitor
► Critical region
► Critical section
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
► True
► False
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler
MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----
1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes
User interface
Hardware
Kernel
None of the given options
DOS
Windows
UNIX
None of the given options
. (dot)
# ( hash )
/ (slash)
~ (tilt)
The creating process is called a--------------- process while the new processes are
called the -------------- of that process
Bounded
Unbounded
Both Unbounded & bounded
Bounded
Unbounded
None of the given options
Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options
File descriptor
Input Redirection
Output Redirection
FIFO
ps
www.vustudents.ning.com
top
who
ls
<Ctrl-A>
fg
jobs
kill -l
The time it takes for the dispatcher to stop one process and start another running
is known as the-----------.
Dispatch latency
Scheduling
Context switching
None of the given options
preemptive
non-preemptive
both preemptive and non- preemptive none of the given options
Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options
First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority
Application software
Bus speed of the system
Memory
Virtual memory
Long term
Short term
Medium term
Swapper
A parent process calling __________ system call will be suspended until children process
terminates.
wait
fork
exit
exec
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin
10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
www.vustudents.ning.com
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct
11. Taking the CPU from one process and giving the CPU to another process is termed
as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking
13. A Process that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork
15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not
17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0
19. When a process opens its first file explicitly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4
www.vustudents.ning.com
www.vustudents.ning.com
CS604: QUIZES
/bin
/dev
/boot
/etc
True
False
Command
Process
Software
Compiler
Kernel threads
FCFS scheduling
Pipe
Read
www.vustudents.ning.com
Write
Open
0
1
2
3
ANSI
IEEE
ISO
ACM
man
wan
desc
help
ls not sure
ps
gcc
cat
Same
Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management. in page#71
ps
gcc
cat
ls
cs
top p # 64
cd
Little’s Formula p # 94
Deterministic Modeling
Queuing Theory
Queuing analysis
Non-preemptive SJF
Priority Scheduling
FCFS
When process opens its first file explicitly it will get descriptor number _________
1
www.vustudents.ning.com
2
3
4
MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 21 ( Marks: 2 )
True or False? (and explain): the Multi-Level Feedback Queue (MLFQ) scheduling
algorithm is the same as Shortest-Job-First.
What does the term ‘input redirection’ mean? Write down the basic syntax
for input, output and error redirection of UNIX/LINUX system.
When we use the fork( ) system call? Give three reasons for its failure. Also write the
attributes which are inherited and which are not inherited by the child process from its
parent?
Total 23 Questions
MCQs 16
Ans:
This scheme leaves I/O bound and interactive processes in the higher-
priority queues. Similarly a process that waits too long in a lower-
priority queue may be moved o a higher priority queue. This form of
aging prevents starvation.
ƒ Number of queues
Ans:
4. There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
www.vustudents.ning.com
copy file1 file2 ……..//to copy „file1‟ to „file2‟
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. I/O bound process spend
more time doing I/O than computation. Pipes are used for communication between
related processes on a system.
Q. About spinlock..3marks
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
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
to file2.
IO bound process spend more time doing IO than
computation.
Pipes are used for communication between related
processes on a system.
What are pros and cons of multithreading?5 marks
user threadsare supported above kernel and are
operating system.
Inone-to-one model, there is a kernel thread for
MIDTERM
EXAMINATION Spring
2011
CS604- Operating Systems (Session - 3)
Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a scheduler (List
at least 4). 5 marks
Ans:
CPU Utilization
The percentage of time that the CPU is busy.Throughput The number of
processes completing in a unit of time..
Turnaround time The length of time it takes to run a process from initialization
totermination, including all the waiting time.Waiting time The total amount of
time that a process is in the ready queue.Response time The time between
when a process is ready to run and its next I/O request.
www.vustudents.ning.com
2.structure of Software critical section .5marks
Critical Section: A piece of code in a cooperating process in which the process may
updates shared data i.e variable, file, database, etc…. The Entry and Exist sections
comprise solution for the problem.
do
{
Entry section
critical section
Exit section
remainder section
} while(1)
3.Write formula for calculating waiting time in preemptive Shortest Job First Algorithm.
2 marks
Ans:
if Arrival time given...
Waiting Time = Turnaround-Arrival time
for how much time processor will wait to take CPU thay will be ots waiting
time…..in case if Arrival time for all is ZERO then ...jis ko jis time pe pc mila
wohi us k waiting time hay ....
These are that software whose source code is given along with application.
Yes,If a process exits and there are still threads of that process running, they will continue to
run. Higher-priority threads will run before lower-priority threads. The lowest-level
method of blocking other threads from running uses a global “thread critical”
condition. When the condition is set to true the scheduler will not schedule any
existing thread to run. However, this does not block new threads from being created
and run. Certain thread operations (such as stopping or killing a thread, sleeping in
the current thread, or raising an exception) may cause a thread to be scheduled even
when in a critical section.
between threads for accessing the shared resources (e.g., data and files).
This solution ensures mutual exclusion, that is only one process at a time can be
in its critical section. However it does not satisfy the progress requirement, since
it requires strict alternation of processes in the execution of the critical section.
For example, if
www.vustudents.ning.com
turn= =0 and P1 is ready to enter its critical section, P1 cannot do so even though
P0 may be in its remainder section. The bounded wait condition is satisfied
though, because there is an alternation between the turns of the two processes.
total 23
1x16
2x3
3x2
5x2
1.what are two problem of using processes that can be overcome by using the threads (5)
2. find the shortcomming of the given sloution of Critical Section Problem (page 106)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmWmgjK
PAPER#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
3. Assumption made while formulating a solution to the critical section problem. 2 marks
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
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmbAcyA
PAPER#2
Question No: 17 ( Marks: 2 )
What is Convoy Effect?
Flag[i] = True;
Turn = j;
do{
www.vustudents.ning.com
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmfRFni
1)
A code about test and set lock was given to highlight errors 5Marks
2)
3)
4)
5)
6)
7)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmkHFvF
Question No: 3 ( M a r k s: 1 )
The -------------- system call suspends the calling process.
► fork
► wait
► exec
► exit
Question No: 4 ( M a r k s: 1 )
In ---------addressing, the recipient is not required to name the sender.
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
Question No: 5 ( M a r k s: 1 )
-------- command gives a snapshot of the current processes.
► ps
► top
► who
► ls
Question No: 6 ( M a r k s: 1 )
--------------command to resume the execution of a suspended job in the foreground
► fg
► bg
► jobs
► kill
Question No: 7 ( M a r k s: 1 )
You can use the ------------- command to display the status of suspended and background processes
► fg
► bg
► jobs
► kill
Question No: 8 ( M a r k s: 1 )
You can terminate a foreground process by pressing --------------
► <Ctrl-A>
www.vustudents.ning.com
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options
Question No: 9 ( M a r k s: 1 )
A time sharing system is
► Multi tasking
► Interactive
► All of these
► Multi user
Question No: 10 ( M a r k s: 1 )
The main characteristic of a Real time system is
► Efficiency
► Usability
Question No: 11 ( M a r k s: 1 )
Shared libraries and kernel modules are stored in _____________ directory
► /bin
► /dev
► /boot
► /lib
Question No: 12 ( M a r k s: 1 )
__________ scheduler selects the process from the job pool and put them in main memory.
► Long term
► Short term
► Medium term
► Swapper
Question No: 13 ( M a r k s: 1 )
In indirect inter process communication, a sender ___ mention the name of the recipient.
► do
► do not
Question No: 14 ( M a r k s: 1 )
A ______________ is an integer variable that, apart from initialization is accessible only through two standard atomic
operations: wait and signal.
► Semaphore
► Monitor
► Critical region
► Critical section
Question No: 15 ( M a r k s: 1 )
A semaphore that cause Busy-Waiting is termed as ___________.
► Spinlock
► Monitor
► Critical region
► Critical section
www.vustudents.ning.com
Question No: 16 ( M a r k s: 1 )
The execution of critical sections must NOT be mutually exclusive
► True
► False
Question No: 17 ( M a r k s: 1 )
The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.
► True
► False
Question No: 18 ( M a r k s: 1 )
The following requirement for solving critical section problem is known as ______________.
“There exists a bound on the number of times that other processes are allowed to enter their critical sections after a process
has made a request to enter its critical section and before that request is granted.”
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
Question No: 19 ( M a r k s: 1 )
The critical section problem can be solved by the following except
Question No: 20 ( M a r k s: 1 )
___________ is also called Swapper.
► Swap space
Question No: 21 ( M a r k s: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job First scheduling.
Question No: 22 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Question No: 23 ( M a r k s: 3 )
If a process exits and there are still threads of that process running, will they continue to run?
Question No: 24 ( M a r k s: 3 )
What are the important characteristics of TestAndSet? What will be its advantage.
Question No: 25 ( M a r k s: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟ an advantage of a thread or
disadvantage of a thread. Explain yours answer briefly.
Question No: 26 ( M a r k s: 5 )
Analyze the given algorithm proposed to solve the critical section problem. Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmr5hAI
► OS/2
► Windows
► Unix
► None of the above
►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)
► System Call
► Command
► Directory
► None of Above
► ps
► top
► who
► ls
► CPU Burst
► IO Burst
► Time Slice
► None of Above
► /bin
► /boot
► /dev
► /etc
► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► Command
► Process
► Software
► Compiler
► User interface
► Hardware
► Kernel
► None of the given options
► man
► wan
► desc
► help
int number[n];
www.vustudents.ning.com
CS604 - Operating System - Question No: 19 ( M a r k s: 2 )
How a pipe can be created?
Ans: The pipe() system call creates a pipe and returns two file descriptors, one
for
reading and second for writing. The files associated with these
file descriptors are streams and are both opened for reading and writing.
Naturally, to use
such a channel properly, one needs to form some kind of protocol in which data
is sent
If no process is executing in its critical section and some processes wish to enter
their
critical sections, then only those processes that are not executing in their
remainder
section can participate in the decision on which will enter its critical section next,
and
3. Bounded Waiting
There exists a bound on the number of times that other processes are allowed to
enter
their critical sections after a process has made a request to enter its critical
section and
www.vustudents.ning.com
starvation). A process that is ready to run but lacking the CPU can be
considered
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either
the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and
P1 could not have found both conditions in the while statement true at the same
time,
www.vustudents.ning.com
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0
must have
total Qs 26.
20 MCQs.
2Qs of 2 marks.
2Qs of 3 marks.
2Qs of 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.
Total 23 Questions
www.vustudents.ning.com
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
3. Assumption made while formulating a solution to the critical
section problem. 2 marks
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
6. Write formula for calculating waiting time in preemptive Shortest
Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks
1.Analyze the given algorithm proposed to solve the critical section problem.
Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
: 5marks
2.List and define the different metrics by which we might evaluate a scheduler
(list at least 4)
5marks
3. How can you differentiate between a library call and a system call? Explain
briefly giving at least one example.
3marks
The library function executes the instruction following trap; interprets the return
values from the kernel and returns to the user process.
4. Define the terms "Bounded Waiting" and "Progress" with respect to Critical
Section Problem. (3 marks)
Bounded Waiting :
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
before that request is granted.
Progress :
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
this selection cannot be postponed indefinitely.
www.vustudents.ning.com
5. How can you differentiate between the fifo and pipe?(2 marks)
2 Questions of 2 marks:
1) What are the three requirements for the solution of critical
section problems
2) mkfifo() call may fail due to many reason. Describe the situations
in which mkfifo() command will terminate and also describe the
situations in which the mkfifo() command will not terminate
2 Questions of 5 marks:
1) What are the advantages of Round Ribon scheduling algorithm and
what are the disadvantages of this scheduling algorithm
2) Highlight the shortcoming in the following hardware solution
do
{
while(testandset(lock));
critical section
lock=false;
remainder section
}while(1);
3. Small
4. Large
5. interactive
6. Non-interactive
www.vustudents.ning.com
7. Fore ground
8. Preemptive
5. Non-preemptive scheduling
6. Preemptive scheduling
7. Dispatching scheduling
8. FCFS scheduling
The procedure “The time at which the process finished working MINUS the
arrival time of the process MINUS CPU burst for that process” will help
calculate the _________.
3. Kernel
4. User
First _______ entries in Per Process File Descriptor Table are used as soon
as the process is created.
1
2
3
4
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Taking the CPU from one process and giving the CPU to another process is termed
as
5. Context switching
6. Dispatching
7. Swapping
8. Tracking
Same
Different
Kernel threads
ls
ps
www.vustudents.ning.com
gcc
cat
In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:
6. File
7. Screen
8. Printer
9. Scanner
10.
5. nice
6. cmd
7. cat
8. grep
ls
cs
top
cd
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
5. Little’s Formula
6. Deterministic Modeling
7. Queuing Theory
8. Queuing analysis
The process id returned to the child process after successful fork system call
execution is ______.
www.vustudents.ning.com
0
1
2
3
Priority
Weight
Time
Scheduling
In Unix/ Linux, by default the standard input file is attached to the ___________
Select correct option:
Mouse
Keyboard
Light pen
Joystick
Deadlock
Aging
Starvation
None of these
A solution to the critical section problem must satisfy the following three requirements:
Mutual Exclusion
www.vustudents.ning.com
Progress
Bounded Waiting
Non-preemptive SJF
Priority Scheduling
FCFS
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
Round Robin algorithm is most suitable for __________.
Time sharing system
Real time systems and batch systems
Running Batch programs
Expert system
If your processor does not have two slots empty in Per Process File Descriptor Table,
then your _________ system call will fail.
5. Pipe
6. Read
7. Write
8. Open
5. Round Robin
6. First Come First Serve
7. Multilevel Feedback Queue
8. Shortest Remaining Time First
MIDTERM
EXAMINATION Spring
2010
CS604- Operating Systems (Session - 3)
Time: 60 min
Marks: 40
► Interrupt
► Signal
► Trap
► Process
►l
l
►s
► ls
► none of the given options
► fork
► wait
► exec
► exit
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► ps
► top
► who
► ls
► fg
► bg
► jobs
► kill
► fg
► bg
► jobs
► kill
► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options
► Multi tasking
► Interactive
► All of these
► Multi user
► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability
► Long term
► Short term
► Medium term
► Swapper
► do
► do not
► Semaphore
► Monitor
► Critical region
► Critical section
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
► True
► False
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler
MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----
1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes
User interface
Hardware
Kernel
None of the given options
DOS
Windows
UNIX
None of the given options
. (dot)
# ( hash )
/ (slash)
~ (tilt)
The creating process is called a--------------- process while the new processes are
called the -------------- of that process
Bounded
Unbounded
Both Unbounded & bounded
Bounded
Unbounded
None of the given options
Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options
File descriptor
Input Redirection
Output Redirection
FIFO
ps
www.vustudents.ning.com
top
who
ls
<Ctrl-A>
fg
jobs
kill -l
The time it takes for the dispatcher to stop one process and start another running
is known as the-----------.
Dispatch latency
Scheduling
Context switching
None of the given options
preemptive
non-preemptive
both preemptive and non- preemptive none of the given options
Preemptive only
non-preemptive only
preemptive or non-preemptive.
None of the given options
First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority
Operating system
Application software
All Software
All of the given
Application software
Bus speed of the system
Memory
Virtual memory
Long term
Short term
Medium term
Swapper
A parent process calling __________ system call will be suspended until children process
terminates.
wait
fork
exit
exec
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin
10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
www.vustudents.ning.com
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct
11. Taking the CPU from one process and giving the CPU to another process is termed
as
a) Context Switching
b) Dispatching
c) Swapping
d) Tracking
13. A Process that has finished working, as well as its parent process has also finished its
execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork
15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not
17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0
19. When a process opens its first file explicitly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4
www.vustudents.ning.com
www.vustudents.ning.com
CS604: QUIZES
/bin
/dev
/boot
/etc
True
False
Command
Process
Software
Compiler
Kernel threads
FCFS scheduling
Pipe
Read
www.vustudents.ning.com
Write
Open
0
1
2
3
ANSI
IEEE
ISO
ACM
man
wan
desc
help
Kernel threads
ls not sure
ps
gcc
cat
Same
Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management. in page#71
ps
gcc
cat
ls
cs
top p # 64
cd
Little’s Formula p # 94
Deterministic Modeling
Queuing Theory
Queuing analysis
Non-preemptive SJF
Priority Scheduling
FCFS
When process opens its first file explicitly it will get descriptor number _________
1
www.vustudents.ning.com
2
3
4
MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 21 ( Marks: 2 )
True or False? (and explain): the Multi-Level Feedback Queue (MLFQ) scheduling
algorithm is the same as Shortest-Job-First.
What does the term ‘input redirection’ mean? Write down the basic syntax
for input, output and error redirection of UNIX/LINUX system.
When we use the fork( ) system call? Give three reasons for its failure. Also write the
attributes which are inherited and which are not inherited by the child process from its
parent?
Total 23 Questions
MCQs 16
Ans:
This scheme leaves I/O bound and interactive processes in the higher-
priority queues. Similarly a process that waits too long in a lower-
priority queue may be moved o a higher priority queue. This form of
aging prevents starvation.
ƒ Number of queues
Ans:
4. There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
www.vustudents.ning.com
copy file1 file2 ……..//to copy „file1‟ to „file2‟
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. I/O bound process spend
more time doing I/O than computation. Pipes are used for communication between
related processes on a system.
Q. About spinlock..3marks
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
21. Which command is used to resume the execution of a suspended job in the
background? (3 marks)
22. Define race condition? (3 marks)
23. How to implement RR scheduling? (5 marks)
24. Highlight critical sections of this code? (5 marks)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
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
to file2.
IO bound process spend more time doing IO than
computation.
Pipes are used for communication between related
processes on a system.
What are pros and cons of multithreading?5 marks
user threadsare supported above kernel and are
operating system.
Inone-to-one model, there is a kernel thread for
MIDTERM
EXAMINATION Spring
2011
CS604- Operating Systems (Session - 3)
Total 23 Questions
MCQs 16
1. List and define the different metrics by which might evaluate a scheduler (List
at least 4). 5 marks
Ans:
CPU Utilization
The percentage of time that the CPU is busy.Throughput The number of
processes completing in a unit of time..
Turnaround time The length of time it takes to run a process from initialization
totermination, including all the waiting time.Waiting time The total amount of
time that a process is in the ready queue.Response time The time between
when a process is ready to run and its next I/O request.
www.vustudents.ning.com
Critical Section: A piece of code in a cooperating process in which the process may
updates shared data i.e variable, file, database, etc…. The Entry and Exist sections
comprise solution for the problem.
do
{
Entry section
critical section
Exit section
remainder section
} while(1)
3.Write formula for calculating waiting time in preemptive Shortest Job First Algorithm.
2 marks
Ans:
if Arrival time given...
Waiting Time = Turnaround-Arrival time
for how much time processor will wait to take CPU thay will be ots waiting
time…..in case if Arrival time for all is ZERO then ...jis ko jis time pe pc mila
wohi us k waiting time hay ....
These are that software whose source code is given along with application.
Yes,If a process exits and there are still threads of that process running, they will continue to
run. Higher-priority threads will run before lower-priority threads. The lowest-level
method of blocking other threads from running uses a global “thread critical”
condition. When the condition is set to true the scheduler will not schedule any
existing thread to run. However, this does not block new threads from being created
and run. Certain thread operations (such as stopping or killing a thread, sleeping in
the current thread, or raising an exception) may cause a thread to be scheduled even
when in a critical section.
between threads for accessing the shared resources (e.g., data and files).
This solution ensures mutual exclusion, that is only one process at a time can be
in its critical section. However it does not satisfy the progress requirement, since
it requires strict alternation of processes in the execution of the critical section.
For example, if
www.vustudents.ning.com
turn= =0 and P1 is ready to enter its critical section, P1 cannot do so even though
P0 may be in its remainder section. The bounded wait condition is satisfied
though, because there is an alternation between the turns of the two processes.
total 23
1x16
2x3
3x2
5x2
1.what are two problem of using processes that can be overcome by using the threads (5)
2. find the shortcomming of the given sloution of Critical Section Problem (page 106)
do
{
while (TestAndSet(lock)) ;
Critical section
lock=false;
Remainder section
} while(1);
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmWmgjK
PAPER#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
3. Assumption made while formulating a solution to the critical section problem. 2 marks
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
6. Write formula for calculating waiting time in preemptive Shortest Job First Algorithm. 2 marks
7. Define race condition and how prevent this condition. 2 marks
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmbAcyA
PAPER#2
Question No: 17 ( Marks: 2 )
What is Convoy Effect?
Flag[i] = True;
Turn = j;
do{
www.vustudents.ning.com
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmfRFni
1)
A code about test and set lock was given to highlight errors 5Marks
2)
3)
4)
5)
6)
7)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmkHFvF
Question No: 3 ( M a r k s: 1 )
The -------------- system call suspends the calling process.
► fork
► wait
► exec
► exit
Question No: 4 ( M a r k s: 1 )
In ---------addressing, the recipient is not required to name the sender.
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
Question No: 5 ( M a r k s: 1 )
-------- command gives a snapshot of the current processes.
► ps
► top
► who
► ls
Question No: 6 ( M a r k s: 1 )
--------------command to resume the execution of a suspended job in the foreground
► fg
► bg
► jobs
► kill
Question No: 7 ( M a r k s: 1 )
You can use the ------------- command to display the status of suspended and background processes
► fg
► bg
► jobs
► kill
Question No: 8 ( M a r k s: 1 )
You can terminate a foreground process by pressing --------------
► <Ctrl-A>
www.vustudents.ning.com
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options
Question No: 9 ( M a r k s: 1 )
A time sharing system is
► Multi tasking
► Interactive
► All of these
► Multi user
Question No: 10 ( M a r k s: 1 )
The main characteristic of a Real time system is
► Efficiency
► Usability
Question No: 11 ( M a r k s: 1 )
Shared libraries and kernel modules are stored in _____________ directory
► /bin
► /dev
► /boot
► /lib
Question No: 12 ( M a r k s: 1 )
__________ scheduler selects the process from the job pool and put them in main memory.
► Long term
► Short term
► Medium term
► Swapper
Question No: 13 ( M a r k s: 1 )
In indirect inter process communication, a sender ___ mention the name of the recipient.
► do
► do not
Question No: 14 ( M a r k s: 1 )
A ______________ is an integer variable that, apart from initialization is accessible only through two standard atomic
operations: wait and signal.
► Semaphore
► Monitor
► Critical region
► Critical section
Question No: 15 ( M a r k s: 1 )
A semaphore that cause Busy-Waiting is termed as ___________.
► Spinlock
► Monitor
► Critical region
► Critical section
www.vustudents.ning.com
Question No: 16 ( M a r k s: 1 )
The execution of critical sections must NOT be mutually exclusive
► True
► False
Question No: 17 ( M a r k s: 1 )
The performance of Round Robin algorithm does NOT depends heavily on the size of the time quantum.
► True
► False
Question No: 18 ( M a r k s: 1 )
The following requirement for solving critical section problem is known as ______________.
“There exists a bound on the number of times that other processes are allowed to enter their critical sections after a proces s
has made a request to enter its critical section and before that request is granted.”
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
Question No: 19 ( M a r k s: 1 )
The critical section problem can be solved by the following except
Question No: 20 ( M a r k s: 1 )
___________ is also called Swapper.
► Swap space
Question No: 21 ( M a r k s: 2 )
Write the formula/ procedure for calculating the waiting time in preemptive Shortest Job First scheduling.
Question No: 22 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Question No: 23 ( M a r k s: 3 )
If a process exits and there are still threads of that process running, will they continue to run?
Question No: 24 ( M a r k s: 3 )
What are the important characteristics of TestAndSet? What will be its advantage.
Question No: 25 ( M a r k s: 5 )
Considering the Resource sharing feature of thread, what do you think is „resource sharing‟ an advantage of a thread or
disadvantage of a thread. Explain yours answer briefly.
Question No: 26 ( M a r k s: 5 )
Analyze the given algorithm proposed to solve the critical section problem. Identify the shortcomings of this algorithm.
do{
while(turn!=j);
critical section
turn=j;
remainder section
} while(1)
Read more: CS604 Current Mid Term Papers Nov 2011, (Fall 2011) - Virtual University of
Pakistan http://vustudents.ning.com/group/cs604operatingsystems/forum/topics/cs604-current-mid-term-papers-spring-
2011-26-11-2011?xg_source=activity#ixzz1fMmr5hAI
► OS/2
► Windows
► Unix
► None of the above
►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)
► System Call
► Command
► Directory
► None of Above
► ps
► top
► who
► ls
► CPU Burst
► IO Burst
► Time Slice
► None of Above
► /bin
► /boot
► /dev
► /etc
► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► Command
► Process
► Software
► Compiler
► User interface
► Hardware
► Kernel
► None of the given options
► man
► wan
► desc
► help
int number[n];
www.vustudents.ning.com
reading and second for writing. The files associated with these
file descriptors are streams and are both opened for reading and writing.
Naturally, to use
such a channel properly, one needs to form some kind of protocol in which data
is sent
If no process is executing in its critical section and some processes wish to enter
their
critical sections, then only those processes that are not executing in their
remainder
section can participate in the decision on which will enter its critical section next,
and
3. Bounded Waiting
There exists a bound on the number of times that other processes are allowed to
enter
their critical sections after a process has made a request to enter its critical
section and
www.vustudents.ning.com
starvation). A process that is ready to run but lacking the CPU can be
considered
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either
the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and
P1 could not have found both conditions in the while statement true at the same
time,
www.vustudents.ning.com
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0
must have
paper of CS604.
Regards,
mc080403856
http://vusr.net
My today cs604 paper _____ dated: 16-05-11
1. define throughput
2. write priority formula
3. write a swap function
4. when mkfifo call fails
5. pros and cons of Round robin algorithm
6. coding wala aik q tha coding d hoi thi to us main se error find krne the.
7. what is command to read from input file instead of standard input file.
1. define throughput
2. write priority formula
3. write a swap function
4. when mkfifo call fails
5. pros and cons of Round robin algorithm
6. coding wala aik q tha coding d hoi thi to us main se error find krne the.
7. what is command to read from input file instead of standard input file.
8. MIDTERM EXAMINATION
SPRING 2011 (12 MAY 2011)
CS604- OPERATING SYSTEMS
Time: 60 min
Marks: 38
► OS/2
► Windows
► Unix
► None of the above
www.vustudents.ning.com
►. (dot)
► # ( hash )
► / (slash)
► ~ (tilt)
► System Call
► Command
► Directory
► None of Above
► ps
► top
► who
► ls
► CPU Burst
► IO Burst
► Time Slice
► None of Above
► context switching
► scheduling
► quantum period
► latency
► /bin
► /boot
► /dev
www.vustudents.ning.com
► /etc
► Non-preemptive SJF
► Priority Scheduling
► Preemptive Shortest Job First
► FCFS
► Spinlock
► Monitor
► Critical region
► Critical section
► True
► False
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► True
► False
► Command
► Process
► Software
► Compiler
www.vustudents.ning.com
Question No: 14 ( Marks: 1 ) - Please choose one
The critical section problem can be solved by the following except
► User interface
► Hardware
► Kernel
► None of the given options
► man
► wan
► desc
► help
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
27. Ans: To prove mutual exclusion, note that Pi enters its critical section only if
either
28. flag[j]=false or turn=i. Also, if both processes were executing in their critical
sections at
29. the same time, then flag[0]= = flag[1]= = true. These two observations suggest
that P0 and
30. P1 could not have found both conditions in the while statement true at the same
time,
31. since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must
have
32. successfully exited the while statement. Hence mutual exclusion is preserved.
Total 23 Questions
MCQs 16
www.vustudents.ning.com
1. List and define the different metrics by which might
evaluate a scheduler (List at least 4). 5 marks
www.vustudents.ning.com
MIDTERM
EXAMINATION
Spring 2010
CS604- Operating Systems (Session - 3)
Time: 60 min
Marks: 40
► Interrupt
► Signal
► Trap
► Process
►
II
►s
► ls
► none of the given options
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► ps
► top
► who
► ls
► fg
► bg
► jobs
► kill
► fg
► bg
► jobs
► kill
► <Ctrl-A>
► <Ctrl-C>
► <Ctrl-Z>
► None of the given options
► Multi tasking
► Interactive
► All of these
► Multi user
► Efficiency
► Large Virtual Memory
► Large secondary storage device
► Usability
► Long term
► Short term
► Medium term
► Swapper
Question No: 13 (Marks: 1 ) - Please choose one
In indirect inter process communication, a sender mention the name of the recipient.
► Do
► do not
► Semaphore
► Monitor
► Critical region
► Critical section
► Spin lock
► Monitor
► Critical region
► Critical section
Question No: 16 ( Marks: 1 ) - Please choose one
The execution of critical sections must NOT be mutually exclusive
► True
► False
► True
► False
► Progress
► Bounded Waiting
► Mutual Exclusion
► Critical Region
► Swap space
► Medium term scheduler
► Short term scheduler
► Long term scheduler
MIDTERM EXAMINATION
Spring 2009
CS604- Operating Systems (Session - 1)
Question No: 1 ( Marks: 1 ) - Please choose one
I MB or 1 megabyte is equivalent to----
1024 bytes
10242 bytes (may be this)
10243 bytes
1000000 bytes
User interface
Hardware
Kernel
None of the given options
DOS
Windows
UNIX
None of the given options
Files that start with a -------- in UNIX/Linux directory structure are known as hidden files .
. (dot)
# ( hash )
/ (slash)
~ (tilt)
The creating process is called a--------------- process while the new processes are called the
-------------- of that process
Bounded
Unbounded
Both Unbounded & bounded
None of the given options
Pipes
BSD Sockets
Named pipe (FIFO)
None of the given options
File descriptor
Input Redirection
Output Redirection
FIFO
Ps
top
Who
ls
<Ctrl-A>
fg
jobs
kill -l
The time it takes for the dispatcher to stop one process and start another running is known
as the-----------.
Dispatch latency
Scheduling
Context switching
None of the given options
Preemptive
Non-preemptive
Both preemptive and non- preemptive
none of the given options
www.vustudents.ning.com
Question No: 14 (Marks: 1 ) - Please choose one
Preemptive only
Non-preemptive only
Preemptive or non-preemptive.
None of the given options
First-Come-First-Served (FCFS)
Round-Robin
Sorted Job First (SJF)
Priority
Operating system
Application software
All Software
All of the given
Application software
Bus speed of the system
Memory
Virtual memory
Long term
Short term
Medium term
Swapper
www.vustudents.ning.com
Question No: 20 (Marks: 1 ) - Please choose one
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
www.vustudents.ning.com
b) /boot
c) /lib
d) /sbin
10. You can use the mv file1 file2 command to move ______________
a) file1 to file2.
b) file 2 to file 1
c) this command will not work for moving files
d) None of the option is correct.
e) Both option a and b are correct
11. Taking the CPU from one process and giving the CPU to another process is termed as
a) Context switching
b) Dispatching
c) Swapping
d) Tracking
13. A Process A that has finished working, as well as its parent process has also finished
its execution. In this state the process A will be called as _________ process.
a) Child
b) Thread
c) Zombie
d) Fork
15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
d) Self
www.vustudents.ning.com
16. In indirect inter process communication, a sender ________ mention the name of the
recipient.
a) does
b) does not
17. The returned code to the child process after successful fork system call execution is
a) 1
b) 2
c) 3
d) 0
20. In Unix/ Linux, by default the standard input file is attached to the ___________
a) Mouse
b) Keyboard
c) Light pen
d) Joystick
www.vustudents.ning.com
Question # 4 of 10 ( Start time: 06:18:17 PM ) Total Marks: 1
__________ directory includes essential system boot files including the kernel image.
Select correct option:
/bin
/boot
/dev
/etc
True
False
Multi user
Multi tasking
Interactive
All of these
Command
Process
Software
Compiler
System call
Interrupt
Trap
Signal
ls
www.vustudents.ning.com
Cp
mv
mkdir
Question # 6 of 15 ( Start time: 08:30:46 PM ) Total Marks: 1
User mode can run the Privileged instructions.
Select correct option:
True
False
Question # 7 of 15 (Start time: 08:32:13 PM) Total Marks: 1
A parent process calling __________ system call will be suspended until children process
terminates.
Select correct option:
Wait
Fork
Exit
Exec
Pipe
Read
Write
Deadlock
Starvation
Aging
Nice value
Little‟s Formula
Deterministic Modeling
Queuing Theory
Queuing analysis
Round Robin
First Come First Serve
Multilevel Feedback Queue
Shortest Remaining Time First
Interactive
www.vustudents.ning.com
Non-interactive
Foreground
Preemptive
19. When a process opens its first file explicit ly it will get descriptor number
_________
a) 1
b) 2
c) 3
d) 4
Expert system
Kernel threads
Preemptive scheduling
Dispatching scheduling
FCFS scheduling
Pipe
Read
Write
Open
FCFS
RR Scheduling
Priority
Weight
Time
Scheduling
www.vustudents.ning.com
Same
Different
Question # 3 of 10 ( Start time: 03:13:33 PM ) Total Marks: 1
In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:
File
Screen
Printer
Scanner
Small
Large
Round Robin
First Come First Serve
Multilevel Feedback Queue
Shortest Remaining Time First
ls
cs
top
cd
www.vustudents.ning.com
Question # 8 of 10 ( Start time: 03:16:09 PM ) Total Marks: 1
The priorities of processes in the __________ group remain fixed.
Select correct option:
Kernel
User
1
2
3
4
0
1
2
3
ANSI
www.vustudents.ning.com
IEEE
ISO
ACM
Nice
Cmd
Cat
Grep
man
wan
desc
help
ls
ps
gcc
cat
1
2
3
4
Non-preemptive scheduling
Preemptive scheduling
Dispatching scheduling
FCFS scheduling
read
write
www.vustudents.ning.com
open
fork
Same
Different P # 68 not sure
Kernel threads are supported directly by the operating system. The kernel performs
the scheduling, creation, and management in ------ command display the status of a
process.
Select correct option:
ls
ps
gcc
cat
In Unix/ Linux, by default the standard output file is attached to the ___________
Select correct option:
File
Screen
Printer
Scanner
___________ is the basis of queuing theory which is branch of mathematics used to
analyze systems involving queues and servers.
Select correct option:
Little’s Formula
Deterministic Modeling
Queuing Theory
www.vustudents.ning.com
Queuing analysis
Quiz 2:-
The priorities of processes in the __________ group remain fixed.
Select correct option:
Kernel
User
Deadlock
Aging
Starvation
None of these
Non-preemptive SJF
Priority Scheduling
Little‟s Formula
Deterministic Modeling
Queuing Theory
Queuing analysis
In Unix/ Linux, by default the standard output file is attached to the ___________
File
Screen
Printer
Scanner
Bookmark
When process opens its first file explicitly it will get descriptor number _________
1
2
3
4
_______________ scheduling algorithm can be preemptive or non-preemptive.
First Come First Serve
Priority
www.vustudents.ning.com
___________ is a solution to the problem of indefinite blockage of low-priority
processes.
Starvation
Deadlock
Aging
None of the these
Quiz 2:-
The priorities of processes in the __________ group remain fixed.
Select correct option:
Kernel
User
A Process „A‟ that has finished working but its parent process has also finished its
execution. In this state the process „A‟ will be called as _____ process.
Child
thread
zombie
fork
Cooperating processes never share any data, code, memory or state.
True
Fasle
Operating system
Application software
All Software
True
False
Multi user
Multi tasking
Interactive
All of these
Command
Process
Software
Compiler
__________ Scheduler selects the process from the job pool and put them in main
memory.
Long term
Short term
Medium term
Swapper
www.vustudents.ning.com
The process id returned to the child process after successful fork system call execution is
______.
0
1
2
3
ls
ps
gcc
cat
Small
True
Large
True
TRUE
False
Interactive
Non-interactive
TRUE
www.vustudents.ning.com
Foreground
Preemptive
Non-preemptive scheduling
Preemptive scheduling
TRUE
Dispatching scheduling
FCFS scheduling
Kernel
TRUE
www.vustudents.ning.com
User
Same
TRUE
Different
www.vustudents.ning.com
www.vustudents.ning.com
_______ scheduler takes the process from the ready queue and assign the CPU with the
help of Dispatcher.
Long term
Short term
Medium term
Swapper
www.vustudents.ning.com
___________ is also called Swapper.
Long term
Short term
Medium term
Swap spacE
Bounded Buffer is a buffer of ____________ size
Variable
Fixed
________ scheduling algorithm is sometimes called shortest remaining time first
scheduling algorithm.
Non-preemptive SJF
Priority Scheduling
Preemptive Shortest Job First
8. Utilities used for system administration (halt, ifconfig, fdisk, etc.) are stored in
_____________ directory.
a) /dev
b) /boot
c) /lib
d) /sbin
15. In ________ communication the process which wants to communicate with the other
process must explicitly name the recipient and the sender.
a) Direct
b) Indirect
c) Automatic
? context switching
? scheduling
www.vustudents.ning.com
? quantum period
? latency
A semaphore that cause Busy-Waiting is termed as ___________.
Select correct option:
? Spinlock
? Monitor
? Critical region
? Critical section
In ---------addressing, the recipient is not required to name the sender.
Select correct option:
► Symmetric
► Asymmetric
► Both symmetric and asymmetric
► None of the given options
► True
What is Convoy Effect?
Ans: Convoy effect is the result of mechanism in which some one has to follow an order
like the movement of a convoy. In FCFS, a process whether shorter or smaller has to
follow a queue to be assigned to a CPU. T
CS604 - Operating System - Question No: 18 ( M a r k s: 2 )
What are the common data structures in Bakery Algorithm?
Ans: The common data structures are:
int number[n];
reading and second for writing. The files associated with these
file descriptors are streams and are both opened for reading and writing. Naturally, to use
such a channel properly, one needs to form some kind of protocol in which data is sent
If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder
section can participate in the decision on which will enter its critical section next, and
3. Bounded Waiting
There exists a bound on the number of times that other processes are allowed to enter
their critical sections after a process has made a request to enter its critical section and
starvation). A process that is ready to run but lacking the CPU can be considered
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
remainder section
} While(1)
Ans: To prove mutual exclusion, note that Pi enters its critical section only if either
www.vustudents.ning.com
flag[j]=false or turn=i. Also, if both processes were executing in their critical sections at
the same time, then flag[0]= = flag[1]= = true. These two observations suggest that P0
and
P1 could not have found both conditions in the while statement true at the same time,
since the value of „turn‟ can either be 0 or 1. Hence only one process say P0 must have