OS Final

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Which of the following disk head scheduling algorithms does not take into account the current position of the disk head? A) FCFS B) C-SCAN C) SCAN D) All scheduling algorithms take into account the current position of the disk head

A) FCFS

Shortest-remaining-time-first scheduling is the preemptive version of __________? A) SJF B) FCFS C) RR D) Multilevel queue

A) SJF

Which of the following scheduling algorithms gives the minimum average response time? A) SJF B) FCFS C) RR D) Multilevel queue

A) SJF

f an instruction modifies several different locations, a page fault can be handled by A) using temporary registers to hold the values of overwritten locations. B) loading multiple pages in advance. C) incorporating special hardware. D) terminating the process.

A) using temporary registers to hold the values of overwritten locations.

There is a 1:1 correspondence between the number of entries in the TLB and the number of entries in the page table.

False

What are the two types of latency that affect the performance of real-time systems?

Interrupt latency - period of time from the arrival of an interrupt at the CPU to the starts of the routine that services the interrupt Dispatch latency - amount of time required for the scheduling dispatcher to stop one process and start another

Assume process P0 and P1 are the process before and after a context switch, and PCB0 and PCB1 are respectively their process control block. Which of the following time units are included inside the dispatch latency? A) P0 executing B) save state into PCB0, and restore state from PCB1 C) P1 executing D) all of the above

B) save state into PCB0, and restore state from PCB1

The circular-wait condition for a deadlock implies the hold-and-wait condition.

True

What is a disadvantage of the FCFS scheduling algorithm?

Waiting time depends on arrival order Convoy effect: short process stuck waiting for long process Head of the line blocking

The default scheduling class for a process in Solaris is ____. A) time sharing B) system C) interactive D) real-time

A) time sharing

A maskable interrupt can never be disabled.

False

A monitor is an abstract data type that is based on semaphore implementation.

False

A mutex lock is released immediately after entering a critical section.

False

In RR scheduling, the time quantum should be small with respect to the context-switch time.

False

The buddy system for allocating kernel memory is very likely to cause fragmentation within the allocated segments.

True

Which of the following scheduling algorithm may suffer from convoy effect? A) SJF B) FCFS C) RR D) Multilevel queue

B) FCFS

Solid state disks (SSDs) commonly use the ___________ disk scheduling policy. A) C-SCAN B) SCAN C) FCFS D) None of the above

C) FCFS

What is the advantage of C-SCAN over SCAN disk head scheduling?

Provides more uniform wait time

A dedicated device cannot be used concurrently by several processes or threads.

True

How is the effective access time computed for a demand-paged memory system?

A demand-paging system is similar to a paging system with swapping where processes reside in secondary memory. With demand paging, when a process is executed, it is swapped into memory. Rather than swapping the entire process into memory, however, a lazy swapper is used. A lazy swapper never swaps a page into memory unless that page will be needed. Thus, a paging system with swapping manipulates entire processes, whereas a demand pager is concerned with the individual pages of a process.

What three conditions must be satisfied in order to solve the critical section problem?

1) no thread may be executing in its critical section if a thread is currently executing in its critical section. 2) only threads that are not executing in their critical sections can participate in the decision on which process will enter its critical section next. 3) a bound must exist on the number of times that other threads are allowed to enter their critical state after a thread has made a request to enter its critical state.

Explain the usefulness of a modify bit.

A modify bit is associated with each page frame. If a frame is modified, the modify bit is then set. The modify bit is useful when a page is selected for replacement. If the bit is not set, the page does not need to be written to disk. If the modify bit is set, the page needs to be written to disk when selected for replacement.

Explain what race condition is.

A race condition occurs when two or more threads can access shared data and they try to change it at the same time. Because the thread scheduling algorithm can swap between threads at any time, you don't know the order in which the thread will attempt to access the shared data. Therefore, the result of the change in data is dependent on the thread scheduling algorithm.

Explain the difference between a serial-port controller and a SCSI bus controller.

A serial-port controller is a simple device controller with a single chip that controls the signals on the wires of a serial port. By contrast, a SCSI bus controller is not simple. Because the SCSI protocol is complex, the SCSI bus controller is often implemented as a separate circuit board that plugs into the computer

Which of the following can be a solution to the problem of indefinite blockage of low-priority processes? A) Aging B) Starvation C) Multilevel queue D) All of the above

A) Aging

Which of the following is a software-based solution to the critical-section problem? A) Peterson's solution B) test_and_set C) compare_and_swap D) all of the above

A) Peterson's solution

Which of the following scheduling algorithms gives the minimum average waiting time for a given set of processes? A) SJF B) FCFS C) RR D) Multilevel queue

A) SJF

Which of the following statements regarding solid state disks (SSDs) is false? A) They generally consume more power than traditional hard disks. B) They have the same characteristics as magnetic hard disks, but can be more reliable. C) They are generally more expensive per megabyte than traditional hard disks. D) They have no seek time or latency.

A) They generally consume more power than traditional hard disks.

Which of the following is not a factor in choosing which process to terminate during recovery from a deadlock? A) Who the parent of the process is. B) How many more resources the process needs in order to complete. C) How many processes will need to be terminated. D) What the priority of the process is

A) Who the parent of the process is.

Compared to USB, NVMe provides A) both higher throughput and lower latency. B) higher throughput, but higher latency. C) lower latency, but lower throughput. D) neither higher throughput and lower latency.

A) both higher throughput and lower latency.

Reentrant code is easier to share when paging is used, because A) each process can modify that code its own way. B) the code doesn't change during execution. C) the code changes are identical for each process. D) All of the above.

A) each process can modify that code its own way.

One necessary condition for deadlock is ______, which states that a resource can be released only voluntarily by the process holding the resource. A) hold and wait B) mutual exclusion C) circular wait D) no preemption

A) hold and wait

Which of the following regarding mutex lock is NOT true? A) mutex lock is a hardware solution to critical-section problem B) mutex lock is a higher-level software solution to critical-section problem C) mutex lock suffers from busy waiting D) the general rule of thumb is to use a mutex lock if the lock will be held for a duration less than two context switches

A) mutex lock is a hardware solution to critical-section problem

Component that measures elapsed time and to trigger operations is called a A) programmable interval timer. B) high performance event timer. C) network time protocol. D) socket.

A) programmable interval timer.

What are the three reasons that buffering is performed?

A buffer is a memory area that stores data while they are transferred between two devices or between a device an application. One reason for buffering is to handle data when speed mismatches between the producer and consumer of a data stream exist. The second reason is to adapt between devices that have different data-transfer sizes. The third reason is to support copy semantics for application I/O.

Which of the following is true for race condition? A) race condition occurs where several processes access and manipulate the same data concurrently B) when race condition occurs, the outcome of the execution depends on the particular order in which the access takes place C) both of the above D) none of the above

A) race condition occurs where several processes access and manipulate the same data concurrently

What are the two components of positioning time? A) seek time + rotational latency B) transfer time + transfer rate C) effective transfer rate - transfer rate D) cylinder positioning time + disk arm positioning time

A) seek time + rotational latency

Number of sectors per track increases as we move from inner zone to outer zone, because A) the drive can increase its rotation speed as the head moves from the outer to the inner tracks. B) the drive can decrease its rotation speed as the head moves from the outer to the inner tracks. C) angular velocity of disk rotation can vary. D) angular velocity of disk rotation can remain constant.

A) the drive can increase its rotation speed as the head moves from the outer to the inner tracks.

Anonymous memory of a process refers to A) the pages not associated with the binary executable file of the process. B) the pages associated with the binary executable file of the process. C) the pages associated with the static data of the process. D) the pages that cannot be swapped out of the physical memory.

A) the pages not associated with the binary executable file of the process.

In a blocking system call, the execution of a process is suspended A) until the process is woken up by some other process. B) until a fixed amount of time has elapsed. C) the kernel raises the priority of that process. D) the I/O has completed.

A) until the process is woken up by some other process.

The SCAN scheduling algorithm ____. A) services the request with the minimum seek time B) services the request next to the current head position in the direction of the head movement C) chooses to service the request furthest from the current head position D) services the request next to the current head position in the opposite direction of the head movement

B) services the request next to the current head position in the direction of the head movement

A significant problem with priority scheduling algorithms is _____. A) complexity B) starvation C) determining the length of the next CPU burst D) determining the length of the time quantum

B) starvation

A sign of thrashing is A) the CPU utilization increases as the degree of multiprogramming is increased. B) the CPU utilization decreases as the degree of multiprogramming is increased. C) the CPU utilization increases as the number of pages allocated to each process is increased. D) the CPU utilization decreases as the number of pages allocated to each process is increased.

B) the CPU utilization decreases as the degree of multiprogramming is increased.

Which of the following is NOT true regarding conditional variable, e.g. x? A) The only operations that can be invoked on a condition variable are wait() and signal() B) x.wait() means that the process invoking this operation is suspended until another process invokes x.signal() C) The x.signal() operation resumes exactly one suspended process D) If no process is suspended, then the signal() operation still affects the state of the semaphore

B) x.wait() means that the process invoking this operation is suspended until another process invokes x.signal()

A hard disk drive has 16 platters, 8192 cylinders, and 256 4KB sectors per track. The storage capacity of this disk drive is at most A) 128 TB. B) 32 TB. C) 32 GB. D) 128 GB.

C) 32 GB.

Consider a disk queue holding requests to the following cylinders in the listed order: 210, 67, 11, 99, 87, 90, 19, 150. Using the C-SCAN scheduling algorithm, what is the order that the requests are serviced, assuming the disk head is at cylinder 88 and moving upward through the cylinders? A) 87 - 90 - 99 - 67 - 19 - 11 - 150 - 210 B) 210 - 67 - 11 - 99 - 87 - 90 - 19 - 150 C) 90 - 99 - 150 - 210 - 11 - 19 - 67 - 87 D) 90 - 99 - 150 - 210 - 87 - 67 - 19 - 11

C) 90 - 99 - 150 - 210 - 11 - 19 - 67 - 87

I/O-bound program typically has many short ______ and a CPU-bound program might have a few long __________. A) I/O burst, CPU burst B) I/O burst, I/O burst C) CPU burst, CPU burst D) CPU burst, I/O burst

C) CPU burst, CPU burst

Which of the following is true? A) No deadlock implies no starvation; B) No starvation implies no deadlock; C) Deadlock doesn't imply starvation; D) Starvation implies deadlock.

C) Deadlock doesn't imply starvation;

Which of the following scheduling algorithms must be nonpreemptive? A) SJF B) RR C) FCFS D) priority algorithms

C) FCFS

Buffering in I/O is used to A) cope with a speed mismatch between the producer and consumer of a data stream. B) provide adaptations for devices that have different data-transfer sizes. C) support copy semantics for application I/O. D) All of the above.

D) All of the above.

Which of the following is TRUE about a serial port controller and a fibre channel (FC) bus controller? A) Both FC bus controller and serial port controller are often implemented as separate circuit boards. B) A serial-port controller is a simple device controller, while an FC bus controller is complex. C) Both FC bus controller and serial port controller are used in PCs. D) All of the above.

D) All of the above.

An advantage of SSDs over HDDs is A) SSDs are cheaper per megabyte than HDDs. B) SSDs are more reliable than HDDs. C) SSDs are faster than HDDs. D) B and C

D) B and C

Which of the following is NOT true for Peterson's solution? A) Mutual exclusion is preserved B) The progress requirement is satisfied C) The bounded-waiting requirement is met D) Peterson's solution works for synchronization among more than two processes

D) Peterson's solution works for synchronization among more than two processes

Which of the following is not true about test_and_set instruction? A) It is a hardware instruction B) It is executed atomically C) Returns the original value of passed parameter D) Returns the new value of passed parameter E) Set the new value of passed parameter to "TRUE"

D) Returns the new value of passed parameter

Which of the following is FALSE about swap space use? A) Swap space may be used to hold an entire process image. B) Swap space may be used to store only pages that have been pushed out of main memory. C) Swap space may be used to store the file system. D) Swap space can be a dedicated swap partition, a swap file, or a combination of swap partitions and swap files.

D) Swap space can be a dedicated swap partition, a swap file, or a combination of swap partitions and swap files.

Which of the following criteria is more important from the point of view of a particular process? A) CPU utilization B) Response time C) Turnaround time D) Throughput

D) Throughput

Which of the following are efforts to towards developing scalable, efficient tools that address the demands of concurrent programming? A) designing compilers that generate more efficient code B) developing languages that provide support for concurrent programming C) improving the performance of existing libraries and APIs D) all of the above

D) all of the above

For interactive systems, it is more important to minimize ________. A) the average response time B) the average turnaround time C) the variance in response time D) the waiting time

D) the waiting time

A reader-writer lock is useful when A) there are a significantly large number of processes attempting to enter a critical section. B) there are a significantly large number of consumer processes attempting to read data from a bounded buffer. C) there are a significantly small number of reader processes attempting to read in the critical section. D) there are a significantly large number of reader processes attempting to read in the critical section.

D) there are a significantly large number of reader processes attempting to read in the critical section.

An I/O system call does not include A) memory address. B) storage device address. C) CPU speed. D) whether the operation is input or output.

D) whether the operation is input or output.

Describe the four conditions that must hold simultaneously in a system if a deadlock is to occur.

For a set of processes to be deadlocked: at least one resources must remain in a nonsharable mode, a process must hold at least one resource and be waiting to acquire additional resources held by other processes, resources in the system cannot be preempted, and a circular wait has to exist between processes.

Explain the concept of a CPU-I/O burst cycle.

The lifecycle of a process can be considered to consist of a number of bursts belonging to two different states. All processes consist of CPU cycles and I/O operations. Therefore, a process can be modeled as switching between bursts of CPU execution and I/O wait.

Hashed page tables are commonly used when handling addresses larger than 32 bits.

True

If the sum of all needs for a resource type exceeds the available number of instances of that resource type, the system state is unsafe

True

Round-robin (RR) scheduling degenerates to first-come-first-served (FCFS) scheduling if the time quantum is too long

True

Solid state disks (SSDs) commonly use the FCFS disk scheduling algorithm.

True

Stack algorithms can never exhibit Belady's anomaly

True

The banker's algorithm is useful in a system with multiple instances of each resource type.

True

The most complex scheduling algorithm is the multilevel feedback-queue algorithm.

True

The preemptive kernel is more suitable for real-time programming than non-preemptive kernel.

True

What effect does the size of the time quantum have on the performance of an RR algorithm?

At one extreme, if the time quantum is extremely large, the RR policy is the same as the FCFS policy. If the time quantum is extremely small, the RR approach is called processor sharing and creates the appearance that each of n processes has its own processor running at 1/n the speed of the real processor.

Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page number? A) 0xAE B) 0xF9 C) 0xA D) 0x00F9

B) 0xF9

Given the reference string of page accesses: 1 2 3 4 2 3 4 1 2 1 1 3 1 4 and a system with three page frames, what is the final configuration of the three frames after the LRU algorithm is applied? A) 1, 3, 4 B) 3, 1, 4 C) 4, 1, 2 D) 1, 2, 3

B) 3, 1, 4

Which of the following statement is correct? A) Base register holds the size of a process. B) Limit register holds the size of a process. C) Base and limit registers can be loaded by the standard load instructions in the instruction set. D) Any attempt by a user program to access memory at an address higher than the base register value results in a trap to the operating system.

B) Limit register holds the size of a process.

Which of the following criteria is more important for an interactive system? A) CPU utilization B) Response time C) Turnaround time D) Throughput

B) Response time

Which of the following is NOT true? A) Since semaphore and mutex lock are tools for synchronization, process that have used semaphores or mutex locks should not cause deadlocks B) Semaphores and mutex locks may be shared resources that difference processes contend for, and hence deadlocks may occur C) a set of processes is in a deadlocked state when every process in the set is waiting for an event that can be caused only by another process in the set D) all of the above

B) Semaphores and mutex locks may be shared resources that difference processes contend for, and hence deadlocks may occur

Suppose that there are ten resources available to three processes. At time 0, the following data is collected. The table indicates the process, the maximum number of resources needed by the process, and the number of resources currently owned by each process. ProcessMaximum NeedsCurrently Owned P0104 P131 P254 At time 1, P1 requests a resource. Which of the following is correct? A) The request will be granted, since the current state is safe. B) The request will not be granted, since the current state is not safe. C) The request will be granted, since the state after granting the request will be safe. D) The request will not be granted, since the state after granting the request will be unsafe.

B) The request will not be granted, since the current state is not safe.

Which of the following is preemptive? A) rate-monotonic scheduling B) earliest-deadline-first scheduling C) both of the above D) none of the above

B) earliest-deadline-first scheduling

Which of the following critical-section problem's requirements limits the amount of time a program will wait before it can enter its critical section? A) mutual exclusion B) progress C) bounded waiting D) none of the above

B) progress

Which of the following items does not belong to the function of a dispatcher? A) switching context from one process to another B) selecting a process among the available ones in the ready queue C) switching to user mode D) jumping to the proper location in the user program to resume that program

B) selecting a process among the available ones in the ready queue

Suppose that there are two resource types (R1 and R2) with five resources each available to four processes. At time 0, the following data is collected. The table indicates the process, the number of resources of each type currently allocated to the processes, and the current request of each resource type by each process. ProcessAllocationRequest R1 R2R1R2 P02 03 2 P11 11 0 P20 11 1 P31 13 2 Which of the following sentences is correct? A) All four processes are currently deadlocked. B) The system is not deadlocked. C) Processes P0 and P3 are deadlocked. D) Processes P0, P1 and P3 are deadlocked.

C) Processes P0 and P3 are deadlocked.

In a system that uses deadlock detection algorithm, A) a deadlock is detected as soon as it occurs. B) a deadlock is detected just before it occurs. C) a deadlock is detected sometime after it has occurred but not necessarily immediately. D) a deadlock is detected sometime before it occurs, but not necessarily just before.

C) a deadlock is detected sometime after it has occurred but not necessarily immediately.

Which of the following actions should be performed among cooperating processes? A) process synchronization B) coordination C) both of the above D) none of the above

C) both of the above

The ______ occurs in first-come-first-served scheduling when a process with a long CPU burst occupies the CPU. A) dispatch latency B) waiting time C) convoy effect D) system-contention scope

C) convoy effect

The surface of a magnetic disk platter is divided into ____. A) sectors B) arms C) tracks D) cylinders

C) tracks

Escape (or back door) in application I/O interface A) allows a user to interrupt a device at any time. B) allows access to a few additional devices, such as a time-of-day clock and a timer. C) transparently passes arbitrary commands from an application to a device driver. D) enables managing of devices with widely varying speeds ranging from a few bytes per second to gigabytes per second.

C) transparently passes arbitrary commands from an application to a device driver.

Which of the following is NOT true regarding semaphore implementation? A) It suffers from the busy waiting problem B) Semaphore has a waiting queue associated with the semaphore C) When a process executes the wait() operation and finds that the semaphore value is not positive, it will suspend itself D) A process that is suspended, waiting on the semaphore, should be restarted when some other process executes a signal() operation.

D) A process that is suspended, waiting on the semaphore, should be restarted when some other process executes a signal() operation.

Which of the following technique is well suited to support very large address space, e.g. 64-bit address space? A) Inverted page tables B) Hierarchical page tables C) Clustered page tables D) All of the above

D) All of the above

A frame table stores A) which frames are allocated. B) which frames are free. C) total number of frames. D) All of the above.

D) All of the above.

A relocation register is used to check for invalid memory addresses generated by a CPU.

False

Disk controllers do not usually have a built-in cache.

False

Fragmentation does not occur in a paging system.

False

In general, SCAN disk head scheduling will involve less movement of the disk heads than C-SCAN disk head scheduling.

False

Reentrant code cannot be shared. True False

False

SCAN disk head scheduling offers no practical benefit over FCFS disk head scheduling.

False

What is the difference between semaphore and mutex lock?

Semaphore: Signaling mechanism Integer variable Allows multiple program threads to access a finite instance of resources Value can be changed by any process acquiring or releasing the resource Can be categorized into counting semaphore and binary semaphore Modified using wait() and signal() operation If all resources are being used the process requesting for resource performs wait() operation and block itself till semaphore count become greater than one Mutex lock: Locking mechanism Object Allow multiple program thread to access a single resource by not simultaneously Object lock is released only by the process that has acquired the lock on it. Object is locked or unlocked by the process requesting or releasing the resource If a mutex object is already locked, the process requesting for resources waits and queued by the system till lock is released.

Explain the sequence of events that happens when a page-fault occurs.

When the OS cannot load the desired page into memory, a page fault occurs. First, the memory reference is checked for validity, the program will be terminated when the request is invalid. If the request was valid, a free frame is located. A disk operation is then scheduled to read the page into the frame just found, update the page, restart the instruction that was interrupted because of the page fault, and use the page accordingly.

Why is DMA used for devices that execute large transfers?

Without DMA, programmed I/O must be used. This involves using the CPU to watch status bits and feed data into a controller register one byte at a time. Therefore, DMA was developed to lessen the burden on the CPU. DMA uses a special purpose processor called a DMA controller and copies data in chunks.


संबंधित स्टडी सेट्स

Online Health Personal and Community Health

View Set

Chapter 4: Consumption, saving, and investment

View Set

american gov and politics chapter 8 on public opinion

View Set