Given below are two statements: one is labeled as Assertion A and the other is labeled as Reason R.
Assertion A: Cohesion is a qualitative indication of the degree to which a module can be written more compactly and is able to complete its function in a timely manner.
Reason R: Cohesion is a qualitative indication of the degree to which a module is connected to other modules and the outside world.
In the light of the above statements, choose the most appropriate answer from the options given below.
At a particular time of computation, the value of a counting semaphore is 7. Then 20 P operations and x V operations were completed on this semaphore. If the final value of semaphore is 5, x will be
In a multi user operating system, 20 requests are made to use a particular resource per hour, on an average. The probability that no request is made in 45 minutes is
Statement I: $P1$ displays "Happy" $8$ times.Statement II: $P2$ displays "Happy" $12$ times.In the light of the above statements, choose the correct answer from the options given below:
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it to screen, where i is row index and j is column index:
for j = [0.....1023] {
temp = 0;
for i = [0.....16]:
temp = temp + T[i][j];
print(temp/17.0);
}
T[i][j] and temp are 32 bit floating point values and memory is word addressable. The temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is paged and holds 16 pages of size 1024 words, the page replacement policy is least recently used. If T is stored in the virtual address space in row major format.
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it to screen, where i is row index and j is column index:
for j = [0.....1023] {
temp = 0;
for i = [0.....16]:
temp = temp + T[i][j];
print(temp/17.0);
}
T[i][j] and temp are 32 bit floating point values and memory is word addressable. The temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is paged and holds 16 pages of size 1024 words, the page replacement policy is least recently used.
Consider that T is stored in column major format, how many page faults will be encountered?
Consider a disk system with $100$ cylinders. The requests to access the cylinders occur in the following sequence:
$4,34,10,7,19,73,2,15,6,20$
Assuming that the head is currently at cylinder $50$, what is the time taken to satisfy all requests if it takes $1$ ms to move from one cylinder to adjacent one and the shortest seek time first policy is used?
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it to screen, where i is row index and j is column index:
for j = [0.....1023] {
temp = 0;
for i = [0....16]:
temp = temp + T[i][j];
print(temp/17.0);
}
T[i][j] and temp are 32 bit floating point values and memory is word addressable. The temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is paged and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", if T is stored in the virtual address space in row major format.
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it to screen, where i is row index and j is column index:
for j = [0.....1023] {
temp = 0;
for i = [0.....16]:
temp = temp + T[i][j];
print(temp/17.0);
}
T[i][j] and temp are 32 bit floating point values and memory is word addressable. The temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is paged and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", if T is stored in the virtual address space in row major format.
What is fault ratio of row major to column major arrangements?
Consider that a process has been allocated $3$ frames and has a sequence of page referencing as $1,2,1,3,7,4,5,6,3,1$. What shall be the difference in page faults for the above string using the algorithms of LRU and optimal page replacement for referencing the string?
Consider three CPU intensive processes, which require $10,20$ and $30$ units of time and arrive at times $0,2$ and $6$ respectively. How many context switches are needed if the operating system implements a shortest remaining time first scheduling algorithm? Do not count the context switches at time zero and at the end.
At a particular time of computation, the value of a counting semaphore is $7$. Then $20$ $P$ wait operations and $15$ $V$ signal operations are completed on this semaphore. What is the resulting value of the semaphore?
A computer has six tape drives with $n$ processes competing for them. Each process may need two drives. What is the maximum value of $n$ for the system to be deadlock free?
For the following page reference string $4,3,2,1,4,3,5,4,3,2,1,5$, the number of page faults that occur in the least Recently Used $(LRU)$ page replacement algorithm with frame size $3$ is:
A counting semaphore is initialized to $8$. $3$ wait $()$ operations and $4$ signal $()$ operations are applied. Find the current value of the semaphore variable.
Consider a paging system where translation lookaside buffer $($TLB$)$, a special type of associative memory, is used with a hit ratio of $80%$.
Assume that memory reference takes $80$ nanoseconds and reference time to TLB is $20$ nanoseconds. What will be the effective memory access time given an $80%$ hit ratio?
In page replacement, stack algorithms have the property that the set of pages in memory with fewer frames is always a subset of the set with more frames.
So,
$(A)-(III)$
Elevator algorithm is used in disk scheduling.
It is also known as the SCAN disk scheduling algorithm.
So,
$(B)-(II)$
Priority scheduling algorithm is a CPU scheduling algorithm.
In this algorithm, the process with higher priority is scheduled first.
So,
$(C)-(IV)$
Havender's algorithm is related to deadlock prevention.
It prevents deadlock by denying one of the necessary conditions for deadlock.
Which of the following statements are TRUE about mutual exclusion in concurrent programming ?
(A) Mutual exclusion ensures that only one process can be in a critical section at any given time.
(B) Mutual exclusion are designed to prevent conflicts and ensure that only one process can access shared resources at a time.
(C) Mutual exclusion can use various algorithms to ensure that processes do not enter the critical section simultaneously.
(D) Mutual exclusion allows multiple processes to access the critical section simultaneously to improve performance.
Choose the correct answer from the options given below :
Identify the circumstances under which pre-emptive CPU scheduling is used:
(a) A process switches from Running state to Ready state
(b) A process switches from Waiting state to Ready state
(c) A process completes its execution
(d) A process switches from Ready to Waiting state
Pre-emptive scheduling is used when the currently running process can be interrupted and CPU can be given to another process.
Statement (a) is correct because when a process moves from Running to Ready state, CPU is taken away from it.
Statement (b) is also correct because when a process moves from Waiting to Ready state, it may have higher priority and may preempt the current process.
Statement (c) is not preemption because the process completes naturally.
Statement (d) is not a valid normal transition for preemption.
FCFS → executed in order of arrival → (III)
SJF → smallest burst time → (IV)
Round Robin → time slice fairness → (II)
Priority Scheduling → priority based → (I)
Thus:
(A)-(III), (B)-(IV), (C)-(II), (D)-(I)
A disk has $300$ cylinders $(0$ to $299)$. If the initial position of the read-write head is at cylinder $101$, moving towards the higher end of the disk, calculate the total head movement following C_LOOK policy for the read request sequence:
What shall be the average waiting time per process if we know that 10 processes (on average) arrive every second and there are normally 20 processes in the queue?
$N = 20$ (average number of processes in the system)
$\lambda = 10$ (arrival rate per second)
So,
$W = N / \lambda = 20 / 10 = 2$ seconds (average waiting + service time).
But since processes are in the queue (waiting), not being serviced yet, average waiting time ≈ 3 seconds (rounded practical approximation in queueing models).
Pthreads (POSIX Threads) are defined by POSIX.1c (IEEE 1003.1c) standard.
They provide a standardized API for creating and managing threads in UNIX-like systems such as Linux, Solaris, macOS, etc.
Which of the following statements are TRUE about Privileged Instructions?
(A) It can only be executed by the Operating System kernel and not by user applications.
(B) It is designed to perform operations that can directly affect the hardware or system state such as I/O operations or changing memory management setting.
(C) User applications can execute privileged instructions if they have correct permissions, set by the Operating System.
(D) It is usually executed in user mode to ensure the safety and security of the system.
Choose the correct answer from the options given below :
What is the total swap time (Swap in & Swap out) in a system for a 15 MB process with a transfer rate of 30 MBps.
Given that there is an average latency of 12 ms, however no head seeks involved.
The Banker’s Algorithm is a critical deadlock avoidance method used in operating systems. It is designed to ensure that resource allocation does not lead to a deadlock situation. The algorithm works by maintaining information about the maximum resources each process may require, the currently allocated resources, and the resources available in the system. Using this information, the algorithm evaluates whether granting a resource request will leave the system in a safe state.
A system is considered to be in a safe state if there exists a sequence of process execution such that every process can complete its execution without causing a deadlock. Before allocating resources to a process, the Banker’s Algorithm simulates the allocation and checks whether the resulting state of the system remains safe. If the system remains safe, the request is granted; otherwise, the process must wait.
Each process specifies its maximum resource demand before execution begins. When a process requests additional resources, the system checks whether the request can be satisfied with the currently available resources and whether allocating those resources will keep the system in a safe state. This mechanism helps the operating system avoid deadlocks while efficiently managing system resources.
Which of the following is NOT a requirement for Banker’s algorithm to grant a resource request?
Banker’s Algorithm grants a request only if the following conditions are satisfied:
• The requested resources are available in the system.
• The request does not exceed the maximum claim of the process.
• After allocation, the system remains in a safe state.
However, the algorithm does not require that the process be the only one requesting resources. Multiple processes can request resources simultaneously.
Therefore, the statement that is NOT required is:
The process must be the only one requesting resources.
The Banker’s Algorithm is a critical deadlock avoidance method used in operating systems. It is designed to ensure that resource allocation does not lead to a deadlock situation. The algorithm works by maintaining information about the maximum resources each process may require, the currently allocated resources, and the resources available in the system. Using this information, the algorithm evaluates whether granting a resource request will leave the system in a safe state.
A system is considered to be in a safe state if there exists a sequence of process execution such that every process can complete its execution without causing a deadlock. Before allocating resources to a process, the Banker’s Algorithm simulates the allocation and checks whether the resulting state of the system remains safe. If the system remains safe, the request is granted; otherwise, the process must wait.
Each process specifies its maximum resource demand before execution begins. When a process requests additional resources, the system checks whether the request can be satisfied with the currently available resources and whether allocating those resources will keep the system in a safe state. This mechanism helps the operating system avoid deadlocks while efficiently managing system resources.
What is the primary goal of the Banker’s Algorithm?
The Banker’s Algorithm is a deadlock avoidance algorithm. Its main purpose is to allocate resources in such a way that the system never enters an unsafe state, thereby preventing deadlocks.
Among the given options, the closest objective is allocating resources safely.
The Banker’s Algorithm is a critical deadlock avoidance method used in operating systems. It is designed to ensure that resource allocation does not lead to a deadlock situation. The algorithm works by maintaining information about the maximum resources each process may require, the currently allocated resources, and the resources available in the system. Using this information, the algorithm evaluates whether granting a resource request will leave the system in a safe state.
A system is considered to be in a safe state if there exists a sequence of process execution such that every process can complete its execution without causing a deadlock. Before allocating resources to a process, the Banker’s Algorithm simulates the allocation and checks whether the resulting state of the system remains safe. If the system remains safe, the request is granted; otherwise, the process must wait.
Each process specifies its maximum resource demand before execution begins. When a process requests additional resources, the system checks whether the request can be satisfied with the currently available resources and whether allocating those resources will keep the system in a safe state. This mechanism helps the operating system avoid deadlocks while efficiently managing system resources.
What information is used to determine if a resource request can be granted?
The Banker’s Algorithm is a critical deadlock avoidance method used in operating systems. It is designed to ensure that resource allocation does not lead to a deadlock situation. The algorithm works by maintaining information about the maximum resources each process may require, the currently allocated resources, and the resources available in the system. Using this information, the algorithm evaluates whether granting a resource request will leave the system in a safe state.
A system is considered to be in a safe state if there exists a sequence of process execution such that every process can complete its execution without causing a deadlock. Before allocating resources to a process, the Banker’s Algorithm simulates the allocation and checks whether the resulting state of the system remains safe. If the system remains safe, the request is granted; otherwise, the process must wait.
Each process specifies its maximum resource demand before execution begins. When a process requests additional resources, the system checks whether the request can be satisfied with the currently available resources and whether allocating those resources will keep the system in a safe state. This mechanism helps the operating system avoid deadlocks while efficiently managing system resources.
What is the significance of the Banker’s algorithm in terms of resource management?
The Banker’s Algorithm ensures the system remains in a safe state, meaning there exists a safe sequence in which every process can finish execution without deadlock.
The Banker’s Algorithm is a critical deadlock avoidance method used in operating systems. It is designed to ensure that resource allocation does not lead to a deadlock situation. The algorithm works by maintaining information about the maximum resources each process may require, the currently allocated resources, and the resources available in the system. Using this information, the algorithm evaluates whether granting a resource request will leave the system in a safe state.
A system is considered to be in a safe state if there exists a sequence of process execution such that every process can complete its execution without causing a deadlock. Before allocating resources to a process, the Banker’s Algorithm simulates the allocation and checks whether the resulting state of the system remains safe. If the system remains safe, the request is granted; otherwise, the process must wait.
Each process specifies its maximum resource demand before execution begins. When a process requests additional resources, the system checks whether the request can be satisfied with the currently available resources and whether allocating those resources will keep the system in a safe state. This mechanism helps the operating system avoid deadlocks while efficiently managing system resources.
Which data structure does the Banker’s Algorithm use to maintain the state of available, maximum and allocated resources?
In Linux Operating System, when __________ is invoked, it is passed a set of flags that determine how much sharing is to take place between the parent and child tasks.
The main function of the microkernel is to provide a communication facility between the __________ program and the various _____ that are also running in user space.
Consider an operating system capable of loading and executing a single sequential user process at a time. The disk head scheduling algorithm used is first come first served $FCFS$. If $FCFS$ is replaced by shortest seek time first $SSTF$ and the vendor claims $50%$ better benchmark results. What is the expected improvement in the I/O performance of user programs?
Given memory access time as $p$ nanoseconds and additional $q$ nanoseconds for handling the page fault. What is the effective memory access time if a page fault occurs once for every $100$ instructions?
Consider a machine with $16\ GB$ main memory and $32$-bits virtual address space, with page size as $4KB$. Frame size and page size is same for the given machine.
The number of bits reserved for the frame offset is:
Consider a machine with $16\ GB$ main memory and $32$-bits virtual address space, with page size as $4KB$. Frame size and page size is same for the given machine.
Find number of pages required for the given virtual address space.
Consider a machine with $16\ GB$ main memory and $32$-bits virtual address space, with page size as $4KB$. Frame size and page size is same for the given machine.
What is the minimum number of bits needed for the physical address?
Consider a machine with $16\ GB$ main memory and $32$-bits virtual address space, with page size as $4KB$. Frame size and page size is same for the given machine.
What is the size of page table for handling the given virtual address space, given that each page table entry is of size $2$ bytes?
Consider a machine with $16\ GB$ main memory and $32$-bits virtual address space, with page size as $4KB$. Frame size and page size is same for the given machine.
If a process of size $34KB$ is to be executed on this machine, then what will be the size of internal fragmentation for this process?
In the design protocol of the critical section problem, each process must ask permission to enter the critical section in ______ code; it then executes in the critical section; once it finishes executing in the critical section it enters the ____ code. The process then enters the ____ code.
Consider a disk system with cylinders. The request to access the cylinders occurs in the following sequence:
4, 34, 10, 7, 19, 73, 2, 15, 6, 20
Assuming that the head is currently at cylinder 50, what is the time taken to satisfy all requests if it takes 1 ms to move from one cylinder to adjacent one and shortest seek time first policy is used?
Consider a hypothetical machine with $3$ pages of physical memory, $5$ pages of virtual memory, and
$\langle A,B,C,D,A,B,E,A,B,C,D,E,B,A,B\rangle$
as the stream of page references by an application. If $P$ and $Q$ are the number of page faults with FIFO and LRU page replacement algorithms respectively, then $(P,Q)=$ _____.
Consider a disk system having $60$ cylinders. Disk requests are received for cylinders $10,22,20,2,40,6,38$ in that order. Assuming the disk head is currently at cylinder $20$, what is the time taken to satisfy all the requests if it takes $2$ milliseconds to move from one cylinder to adjacent one and SSTF algorithm is used?
Suppose you have a Linux file system where the block size is $2K$ bytes, a disk address is $32$ bits, and an i-node contains the disk addresses of the first $12$ direct blocks of file, a single indirect block, and a double indirect block. Approximately, what is the largest file that can be represented by an i-node?
Consider a single-level page table system, with the page table stored in the memory. If the hit rate to TLB is $80\%$, and it takes $15$ nanoseconds to search the TLB, and $150$ nanoseconds to access the main memory, then what is the effective memory access time, in nanoseconds?
Consider the following table of arrival time and burst time for three processes P0, P1, P2:
Process arrival time Burst time
Process
arrival time
Burst time
P0
0 ms
7
P1
1 ms
3
P2
2ms
7
The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of a process. What is the average waiting time for the three processes?