CS604 Mid Term Past Papers Mega File
CS604 Mid Term Past Papers Mega File
COM
1. small
2. Large
1. True
2. False
1. interactive
2. Non-interactive
3. Fore ground
4. Preemptive
1. Non-preemptive scheduling
2. Preemptive scheduling
3. Dispatching scheduling
4. FCFS scheduling
Page 1 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
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
1. True
2. False
Whenprocess 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
Page 3 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. File
2. Screen
3. Printer
4. Scanner
1. nice
2. cmd
3. cat
4. grep
Page 4 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. Little’s Formula
2. Deterministic Modeling
3. Queuing Theory
4. Queuing analysis
In Unix/ Linux, by default the standard output file is attached to the ___________
1. File
2. Screen
3. Printer
4. Scanner
1. Starvation
2. Deadlock
3. Aging
4. None of the these
Page 5 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
_____ 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
1. Interrupt
2. Signal
3. Trap
4. Process
You can display the contents (names of files and directories) of a directory in
UNIX/Linux directory structure with the ————— command.
Page 6 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. ll
2. s
3. ls
4. none of the given options
1. fork
2. wait
3. exec
4. exit
1. Symmetric
2. Asymmetric
3. Both symmetric and asymmetric
4. None of the given options
1. ps
2. top
Page 7 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
3. who
4. ls
1. fg
2. bg
3. jobs
4. kill
You can use the ————- command to display the status of suspended and
background processes
1. fg
2. bg
3. jobs
4. kill
1. <Ctrl-A>
2. <Ctrl-C>
Page 8 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
3. <Ctrl-Z>
4. None of the given options
1. Multi tasking
2. Interactive
3. All of these
4. Multi user
scheduler selects the process from the job pool and put them in main
memory.
1. Long term
2. Short term
3. Medium term
4. Swapper
1. do
2. do not
Page 9 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. Semaphore
2. Monitor
3. Critical region
4. Critical section
1. True
2. False
The performance of Round Robin algorithm does NOT depends heavily on the
size of the time quantum.
1. True
2. False
Page 10 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. Progress
2. Bounded Waiting
3. Mutual Exclusion
4. Critical Region
1. Swap space
2. Medium term scheduler
3. Short term scheduler
4. Long term scheduler
1. 1024 bytes
2. 10242 bytes (may be this)
Page 11 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
3. 10243 bytes
4. 1000000 bytes
1. User interface
2. Hardware
3. Kernel
4. None of the given options
1. DOS
2. Windows
3. UNIX
4. None of the given options
1. rmdir
2. mkdir
3. cp
4. gcc
Page 12 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Files that start with a ——– in UNIX/Linux directory structure are known as
hidden files.
1. . (dot)
2. # ( hash )
3. / (slash)
4. ~ (tilt)
The creating process is called a————— process while the new processes are
called the ————– of that process
1. Bounded
2. Unbounded
3. Both Unbounded & bounded
4. None of the given options
Page 13 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
1. Pipes
2. BSD Sockets
3. Named pipe (FIFO)
4. None of the given options
1. File descriptor
2. Input Redirection
3. Output Redirection
4. FIFO
1. ps
2. top
3. who
4. ls
Page 14 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
You can display all of the signals supported by your system, along with their
numbers, by using the ———–command
1. <Ctrl-A>
2. Fg
3. jobs
4. kill -l
Questions:
QNo.1 List and define the different metrics by which might evaluate a
scheduler (List at least 4). 5 marks
Answer:-
Round-Robin (RR)
Page 15 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Shortest-Job-First (SJF)
Answer:-
Number of queues
Page 16 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Method used to determine which queue a process enters when it needs service
Answer:-
A solution to the critical section problem must satisfy the following three
requirements:
Qno.4 There are many commands. Write the method through which these
commands can communicate with each other. 3 marks
Page 17 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Answer:-
Command Name $ pw
Details
You can display the absolute pathname of your working directory with the pwd
command
Syntax
/home/students/nadeem/courses/cs604/programs
Command Name cp
Details
You can use the cp command for copying files. You can use the cp file1
Syntax
cp ~/file1 ~/memos/file2
Page 18 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Command Name mv
Details
You can use the mv command for moving files. You can use the mv file1
Syntax
$ mv ~/file1 ~/memos/file2
Command Name rm
Details
You can use the rm command to remove files. You can use the rm file1
Syntax
Page 19 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Qno.5 Write Difference between SJF and Shortest Remaining Time First
Scheduling algorithm. 3 marks
Answer:
Qno6. Write the formula/ procedure for calculating the waiting time
in preemptive Shortest Job First scheduling
Page 20 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Answer:-
We illustrate the working of the SJF algorithm by using the following system state.
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
Qno7. Define race condition and how prevent this condition. 2 marks
Answer:-
A situation like this, 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
Page 21 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
When FCFS scheduling algorithm is used, the convoy effect occurs when short
Processes wait behind a long process to use the CPU and enter the ready queue in
a Convoy after completing their I/O.
Page 22 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
The pipe() system call creates a pipe and returns two file descriptors, one for
reading and second for writing,
Process:-
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.
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.
Starvation:-
A process that is ready to run but lacking the CPU can be considered blocked-
waiting for the CPU.
How it occur:-
If time slice is too short then you will have freq switching btw processes
if time slice is too long then you will have less switching btw processes and high
priority may have to wait for low priority tasks leading to starvation
Page 24 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
The average waiting time under the RR policy however is often quite long.
The CPU scheduler goes around the ready queue, allocating the CPU to each
process for a time interval of up to 1 time quantum
The process may have a CPU burst of less than 1 time quantum, in which case the
process itself will release the CPU voluntarily.
Flag[i] = True;
Turn = j;
do{
while(Flag[j] = True && turn==j);
critical section
Flag[i] = False;
Page 25 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
remainder section
} While(1)
Answer:-
To enter its critical section, Pi sets flag[i] to true, and sets ‘turn’ to j, asserting that
if the other process wishes to enter its critical section, it may do so. If both try to
enter at the same time, they will attempt to set ‘turn’ to i and j. However, only
one of these assignments will last, the other will occur but be overwritten
instantly. Hence, the eventual value of ‘turn’ will decide which process gets to
enter its critical section.
To prove mutual exclusion, note that Pi enters its critical section only if either
Page 26 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
process Pi can be prevented the critical section only if it is stuck in the while loop
with the condition flag[j]= =true and turn=j. If Pj is not ready to enter the critical
section, then flag[j]=flase and Pi can enter its critical section. If Pj has set
flag[j]=true and is also executing its while statement then either turn=i or turn=j.
If turn=i then Pi enters its critical section, otherwise Pj. However, whenever a
process finishes executing in its critical section, lets assume Pj, it resets flag[j] to
false allowing Pi to enter its critical section. If Pj resets flag[j]=true, then it must
also set ‘turn’ to i, and since Pi does not change the value of ‘turn’ while executing
in its while statement, Pi will enter its critical section (progress) after at most one
entry by Pj (bounded waiting).
Answer:-
Page 27 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
e, and
-l.
Answer:-
Page 28 of 29
For more papers, go to VUInsider.com
FOR MORE PAPERS, GO TO VUINSIDER.COM
Answer:-
Often access to shared data and shared resources, if there is no controlled access
to shared data, it is often possible to obtain an inconsistent state of this data.
Maintaining data consistency requires mechanisms to ensure the orderly execution
of cooperating processes, and hence various process synchronization methods are
used.
Page 29 of 29
For more papers, go to VUInsider.com