Memory Management and Deadlocks Test Questions -OS

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

which of the following statements about deadlocks is true? A. An unsafe state may lead to a deadlock B. An unsafe state is necessarily, and by definition, a deadlocked state C. A safe state may lead to a deadlock D. An unsafe state cannot lead to a deadlock

A

000001 0011110001, and the following page table: what is the correct 16 bit physical address? A: 0001010011110001 B: 0001100011110001 C: 0110010011110001 D: 0001100011110000

B

if preemption is required to deal with a deadlock, many problems may occur; which of the following is NOT one of the problems that can occur? A. selecting a victim B. mutual exclusion C. Rollback D. starvation E. Recovery mode

B

which of the following memory management requirements is best described as the need for processes to acquire permission to reference memory locations for reading and writing purposes? A: Relocation B: Protection C: Sharing D: Logical organization E: Physical organization

B

which of the following is for Deadlock Avoidance? A: Mutual exclusion B: Safe State C: Hold and Wait D: No Preemption E: Circular Wait

B, this is an avoidance method

which memory management technique has the weakness of external fragmentation? A: Virtual Memory Paging B: Fixed Partitioning C: Dynamic Partitioning D: Simple Segmentation

D

What are the differences between livelock and deadlock? A: In livelock 2 or more threads are stopped waiting for another waiting thread to complete. In deadlock 2 or more threads continue to attempt to do work but obstruct each others progress. B: In livelock 2 or more threads continue to attempt to do work but obstruct each others progress. In deadlock 2 or more threads are stopped waiting for another waiting thread to complete. C: In livelock 1 thread continues to attempt to do work but is obstructed by another waiting thread. In deadlock 2 or more threads attempt to do work but obstruct each others progress. D: In livelock 2 or more threads continue to attempt to do work but obstruct each others progress. In deadlock 1 thread is stuck waiting on another thread that is running indefinitely. E: Livelock is an organic security mechanism like a guard dog. Deadlock is more like a password or padlock.

B

which of the following is a deadlock prevention strategy? A: Resource Allocation Denial B: Mutual Exclusion C: Process Initiation Denial D: Swappable space E: Main memory

B

which of the following is a way to try an attempt to recover from a deadlock? A: aborting all processes in the circular B: aborting one of the processes in the circular wait C: keep running and hope the deadlock fix's itself D: There is no way to every recover from deadlock.

B

which of the following is a weakness for Fixed Partitioning? A: Inefficient use of processor due to the need for compaction to counter external fragmentation. B: Inefficient memory use due to internal fragmentation; the maximum number of active processes is fixed. C: Overhead of complex memory management. D: External fragmentation. E: Complicated to implement.

B

which of the following is not a resource that is reusable? A. I/O channels B. information in I/O buffers C. main memory D. semaphores E. files

B

which of the following is not a technique used for memory management? A. Fixed Partitioning B. Logical Organization C. Virtual Memory Paging D. Virtual Segmentation

B

which of the following the name for the system of memory allocation which scans memory from the location of the most recent allocation and allocates a new process in the first large enough available block? A. Best-fit B. Next-fit C. First-fit D. Worst-fit E. Buddy System

B

which of the following are an advantage of dynamic partitioning? A: Efficient use of processor B: No internal fragmentation C: Little operating system overhead D: Maximum number of active processes is fixed E: It is the fanciest way to split up processes

B, dynamic partitioning avoids internal fragmentation because each allocation is exactly as much memory as it requires

Let's say that we have 10 resources available to 3 processes. Starting at time 0, the following data given by the chart above is collected. The chart tells you the process, the max. number of resources needed by the process, and the number of resources being owned by each process. Which of the following correctly characterizes this state? A.It will never lead to a deadlock. B. It is safe. C. It is unsafe. D. The state cannot be determined. E. The state is not a state.

C

What is the paging method? A: Partition memory into not equal fixed-size chunks that are relatively big B: Partition memory into not equal fixed-size chunks that are relatively small C: Partition memory into equal fixed-size chunks that are relatively big D: Partition memory into equal fixed-size chunks that are relatively small

D

under the normal mode of operation, a thread may utilize a resource in which sequence? A.Request, Release, Use B. Release, Use, Request C. Use, Request, Release D. Request, Use, Release E. A thread may utilize a resource in any sequence

D

what is a segment of memory? A. a variable-length block of data in main memory B. a fixed-length block of data in main memory C. a fixed-length block of data in secondary memory D. a variable-length block of data in secondary memory

D

what is internal fragmentation? A: Chooses the block that is closest in size to the request. B: A process is divided into a number of segments. C: When memory becomes more and more fragmented and memory utilization declines. D: Wasted space due to the block of data loaded being smaller than the partition. E: A system comprised of fixed and dynamic partitioning schemes.

D

when looking at the conditions for deadlock, which best describes circular wait? A: Only one process may use a resource at a time. B: No resource can be forcibly removed from a process holding it. C: A process waiting for other resources can hold current resources until needed resources are obtained. D: A chain of processes such that a process holds a resource that the next process needs in the chain. E: Where everyone waits in a circle for duck duck goose.

D

which of the following best describes the effect of Segmentation? A: A program can be divided into segments that have a maximum length B: Addressing uses a segment number. C: A program can be divided into segments of different lengths. D: Fragmentation will occur as a result of segmentation. E: Addressing uses an offset.

D

which of the following is NOT a characteristic of spinlocks? A: Best used when the wait time for acquiring a lock is expected to be very short B: Locked-out threads will continue to execute in a busy-waiting mode C: Built on an integer location in memory that is checked by each thread before it enters its critical section D: Locked-out threads will stop executing in a busy-waiting mode

D

which of the following is a disadvantage of the Deadline Detection Algorithm? A. No preemption is required. B. The algorithm is not very simple. C. It does not lead to early detection. D. Frequent checks consume considerable processor time. E. It requires the system to restart.

D

which of the following is incorrect about the Buddy System? A: Internal fragmentation is a result of the buddy system B: Mix of fixed and dynamic partitioning C: We take a block, and we keep splitting the block size until it just large enough to access D: Suppose we are freeing block B. When we release block b, if its neighboring blocks are free, we can always combine B with them.

D

which of the followings are address types on the memory? I: Logical Address II: Parent Address III: Relative Address IV: Physical Address V: Child Address A: III, IV, V B: IV, III C: II, V D: I, II, IV E: I

D

which of these is not a common approach to dealing with a deadlock? A: Deadlock detection B: Deadlock prevention C: Deadlock detection D: Hold-And-Wait

D

which of the following is NOT a deadlock avoidance restriction? A: It is necessary to preempt and rollback processes B: Maximum resource requirement for each process must be stated in advance C: Processes under consideration must be independent and with no synchronization requirements D: There must be a fixed number of resources to allocate E: No process may exit while holding resources

a

which of the following is not involved in the interaction between databases and deadlocks? A: wait-for graphs B: transactions C: request matrices D: victims E: locks

c

Deadlocks, the simplest way to prevent deadlocks is to do what? A: Deny circular wait B: No preemption C: no Mutual Exclusion D: Ignore deadlocks exist altogether

A

If Relocatable Code is generated then at what stage is Final Binding of where in memory the process resides completed? a) Load Time b) Compile Time c) Execution Time d) Logical Address e) Interrupt Binding

A

Which of the following does a semaphore NOT not consist of? A: Past value of the semaphore. B: Current value of the semaphore. C: Process ID of the last process to operate on the semaphore. D: Number of processes waiting for the semaphore value to be greater than its current value. E: Number of processes waiting for the semaphore value to be

A

all of the following are required simultaneously for a deadlock situation to occur EXCEPT, A: Preemption B: Circular wait C: Hold and wait D: Mutual exclusion

A

given an object's status is found to be "read lock" which of the following can be happening to that object. A. Multiple threads are read-only accessing that object. B. A thread is currently writing to that object and preventing reads. C. A single thread is reading the object and one is writing to the object D. No threads are accessing the object E. A thread is currently writing to that object and preventing other threads from writing.

A

what describes a logical address? A. Memory location that is completely independent B. Actual location in memory C. A relative Location in memory D. Dependent on Relative Address E. Uses physical Address to find logical address

A

what does the Atomic Bitmap Operation int test_and_set_bit(int nr, void *addr) do ? A. Set bit nr in the bitmap pointed to by addr; return the old bit value B. Clear bit nr in the bitmap pointed to by addr; return the old bit value C. Invert bit nr in the bitmap pointed to by addr; return the old bit value D. Return the value of bit nr in the bitmap pointed to by addr

A

when approaching how to deal with a deadlock, which approach involves periodically checking for the presence of a deadlock and taking action to recover? A: Deadlock Detection B: Deadlock Prevention C: Deadlock Avoidance D: Mutual Exclusion E: Circular Wait

A

which of the following best describes livelock? A: a condition in which a thread continuously attempts an action that fails B: a situation where every thread in a set is blocked waiting for an event that only be caused by another thread in the set C: an edge indicating a resource request D: an edge indicating a resource assignment E: variable length block of data that resides in secondary memory

A

which of the following is not one of the requirements memory management is intended to satisfy. A: Cooperation B: Relocation C: Protection D: Sharing E: Logical Organization

A

which of the following is the correct data structure for "Available", in the bankers algorithm? A: Vector B: Matrix C: Linked List D: Graph E: Tree

A

which of the following is NOT a one of the four conditions needing to happen simultaneously for deadlock to occur. A: Wait-for B: Mutual exclusion C: No preemption D: Hold and wait E: Circular Wait

A, wait-for is a method of deadlock detection

what did he say the purpose of the banker's algorithm was? And what did the two matrices, Allocation matrix A and Claim matrix C, represent? A: A contains the current allocations of each process, and C contains the amount of resources required for each process. Banker's algorithm is used to recover from deadlock. B: A contains the requests by each process, and C contains the total resources allocated to each process. Banker's algorithm is used to recover from deadlock. C: A contains the current allocations of each process, and C contains the amount of resources required for each process. Banker's algorithm is used to avoid deadlocks by checking if allocating resources will result in a deadlock. D: A contains the requests made by each process, and C contains the current allocations of each process. Banker's algorithm is used to avoid deadlocks by checking if allocating resources to processes will result in a deadlock. E: A contains the amount of resources required for each process, and C contains the resources requested by each process. Banker's algorithm is used to recover from deadlock.

C

what is NOT true about Segmentation? A: Addressing uses a segment number B: A program can be divided into segments that vary in length C: Causes internal fragmentation D: Addressing uses an offset E: A program can be divided into segments that have a maximum length

C

what is the UNIX signal that indicates a bad argument to a system call? A. SIGHUP B. SIGINT C. SIGSYS D. SIGBUS E. SIGPIPE

C

which of the following atomic integer operations is the correct way to: Subtract i from v; return 1 if the result is zero; return 0 otherwise A: void atomic_dec(atomic_t *v) B: void atomic_sub(int i, atomic_t *v) C: int atomic_sub_and_test(int i, atomic_t *v) D: int atomic_dec_and_test(atomic_t *v) E: int atomic_sub_and_test(atomic_t *v, int i)

C

which of the following is NOT a commonly used strategy to select a free hole from the set of available holes? A. Best Fit B. First Fit C. Force fit D. Worst Fit E. Next Fit

C

which of the following is NOT a strategy to recover from deadlock? A: Back up each deadlocked process to some previously defined checkpoint and restart all processes B: Abort all deadlocked processes C: Give each processes unlimited CPU resources so every process has sufficient resources D: Successively abort deadlocked processes until deadlock no longer exists E: Successively preempt resources until deadlock no longer exists

C

which of the following is a method of deadlock avoidance? A. Hold and Wait - processes must request all of their required resources at one time and will be blocked unless the resources can be granted simultaneously. B. Mutual exclusion - allowing resource access to one process at a time. C. Process Initiation Denial - stating max resource requirements for each process in advance and having a fixed number of processes to allocate. D. No preemption - if a process is denied denied a further request, it must release its original resources and request them again. E. Circular wait - define a linear ordering of resource types.

C

which of the following is not a valid strategy to recover from a deadlock? A: Abort deadlocked processes until deadlock is cleared B: Back up each deadlocked process to a previous checkpoint and restart all processes C: Pause all processes and run each one sequentially D: Preempt sources until deadlock no longer exists

C

which of the following is true about Banker's Algorithm? A. Banker's algorithm can only be used to detect a deadlock. B. Banker's algorithm can be described as a combination of 4 different algorithms. C. Banker's Algorithm is a method used in resource allocation denial. It is used to determine if a given process might lead to a deadlock. D. Banker's algorithm can only be used to recover from a deadlock.

C

Assume you have a semaphore lock value of 1 and that you have three processes A,B,C that access the process which have a run time of 3,2,6 respectively. If all three process try to access starting at the same point in time (but are in queue order of A,B,C) what will the value of the semaphore lock at time 4? A: -2 B: 1 C: -1 D: 0 E: 42

C,

assume there are three resources, R1, R2 and R3. Each are assigned unique integer values 37, 17 and 38, respectively. What is a resource ordering that prevents a circular wait? A:R2, R3, R1 B: R1, R2, R3 C: R2, R1, R3 D: R3, R2, R1 E: R3, R1, R2

C, represents acquiring resources in sequential order with values of 17, 37,38

how many pages for a program can be referenced if our logical address offset is 10 bits, and the total physical address is 16 bits? A: 1 Page B: 10 Pages C: 6 Pages D: 1024 Pages E: 64 Pages

E

what are the 4 conditions that cause deadlock? A. Mutual Inclusion, proceed without question, removability, and linear execution B. Hold and wait, internal fragmentation, timeout, and mutual exclusion C. No pre-emption, circular wait, scrum, and bus system D. Circular wait, use of a for loop, fork(), and exit() E. Mutual exclusion, hold and wait, no pre-emption, and circular wait

E

what does compaction overcome? A: Fixed partitioning B: Internal fragmentation C: Worst-fit memory allocation D: Holes E: External fragmentation

E

what is one method by which a livelock can typically be avoided? A: Ignore the potential for a livelock to occur in the system B: When a collision occurs, always attempt to retransmit the packet immediately C: Only allow each thread to request resources in an increasing order of enumeration D: Only use sharable resources E: Have each thread retry the failing operation at random times

E

which aspect is NOT explicitly utilized with the Banker's alogrithm? A: Max B: Need C: Available D: Allocation E: Number

E

which is not one of the UNIX Concurrency Mechanisms? A. Semaphores B. Pipes C. Messages D. Shared Memory E. Main memory

E

which of the necessary conditions for a deadlock to occur is the most practical solution to prevent a deadlock because it invalidates one of the necessary conditions. A: Livelock B: Hold and Wait C: Mutual Exclusion D: No Preemption E: Circular Wait

E

which of these is correct about the buddy system A: Buddy System refers to when two blocks of memory are working as a pair and do actions simultaneously. B: Buddy System begins to scan memory from the beginning and chooses the first available block that is large enough. C: Buddy System means a program can be subdivided into segments. D: Buddy System is a reference to a memory location independent of the current assignment of data to memory. E: Buddy system is comprised of fixed and dynamic partitioning schemes.

E


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

Child Development 252 - Chapter 6

View Set

EN 221H: Thomas Paine, Common Sense

View Set

ADN 420 Test 1 (Development & Mobility)

View Set

Geometry Unit 2: Lesson 4, 5, 6, and 7

View Set

Chapter 5-8 BSC 1010C Exam Review

View Set

Gestalt Principles Cognitive Psychology

View Set

Chapter 2: Identify the sections of a classified Balance Sheet

View Set

Psych Quiz 5, P155 Exam 3, Psych Quiz 3-30

View Set