OS Assignment 8

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

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. 1 B. -2 C. -1 D. 0 E. 42

-1

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

0001100011110001

What is a deadlock? A. When the computation takes too long to complete and the computer moves on resulting in an incomplete process B: When 2 computers are executing the same task as the other one resulting in both computers sending too many responses than it was expecting C: When a thread is assigned a task but never gets the info it needs to do the task D: When the cpu is completely filled with either 1's or 0's and unable to change any of them. E. A Deadlock is when 2 computer programs or processes are waiting on the other to complete. This results in both unable being able to complete

A Deadlock is when 2 computer programs or processes are waiting on the other to complete. This results in both unable being able to complete

When looking at the conditions for deadlock, which best describes circular wait? A: A chain of processes such that a process holds a resource that the next process needs in the chain. 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: Only one process may use a resource at a time. E: Where everyone waits in a circle for duck duck goose.

A chain of processes such that a process holds a resource that the next process needs in the chain.

Which of the following best describes the circular wait deadlock condition? A. A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain. B. Only one process may use a resource at a time. C. A process may hold allocated resources while awaiting assignment of other resources. D. No process may access a resource until that has been allocated to another process. E. No resource can be forcibly removed from a process holding it.

A closed chain of processes exists, such that each process holds at least one resource needed by the next process in the chain.

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

Hold-And-Wait

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

Mutual Exclusion

Which aspect is NOT explicitly utilized with the Banker's algorithm? A. Max B. Need C. Available D. Number E. Allocation

Number

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, R1, R3 B: R1, R2, R3 C: R2, R3, R1 D: R3, R2, R1 E: R3, R1, R2

R2, R1, R3

Which of the following is true about Banker's Algorithm? A. 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. B. Banker's algorithm can be described as a combination of 4 different algorithms. C. Banker's algorithm can only be used to detect a deadlock. D. Banker's algorithm can only be used to recover from a deadlock.

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.

Which of these is correct about the buddy system? A: Buddy system is comprised of fixed and dynamic partitioning schemes. 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 refers to when two blocks of memory are working as a pair and do actions simultaneously.

Buddy system is comprised of fixed and dynamic partitioning schemes.

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. Circular Wait B. Deadlock Prevention C. Deadlock Detection D. Deadlock Avoidance E. Mutual Exclusion

Deadlock Detection

What deadlock approach does not grant a resource allocation if that action may lead to deadlock? A. Deadlock avoidance B. Deadlock prevention C. Deadlock detection D. Circular Wait E. Mutual Exclusion

Deadlock avoidance

Which deadlock approach coincide with the following description: Disallow one of the three necessary conditions for deadlock occurrence, or prevent circular wait condition from happening. A. Circular Wait B. Deadlock prevention C. Deadlock avoidance D. Deadlock detection E. Mutual Exclusion

Deadlock prevention

Which of the followings are address types on the memory?(Choose an option that covers all types) I: Logical Address II: Parent Address III: Relative Address IV: Physical Address V: Child Address A: I, II, IV B: IV, III C: II, V D: III, IV, V E: I

I, II, IV

To handle deadlocks, most operating systems will ____? A. Implement protocols to prevent or avoid deadlocks B. Ignore problems with deadlocks C: detect and recover from deadlocks D: use banker's algorithm

Ignore problems with deadlocks

Which of the following is a way a process may respond to a signal? A: Ignoring the signal B: Updating a field in the process table C: Allowing a single thread to access the object for writing at one time, while excluding all readers D: Calling another signal E: Looking at the priority of the interrupt

Ignoring the signal

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

Local Organization

Which of the following options INCORRECTLY describes a spinlock? A. Locked-out threads will continue trying to access the lock even if denied. B. Are most effective where wait time for acquiring a locked is expected to be short. C. Can only be acquired by one thread at a time. D. Most common technique for protecting a critical section in Linux.

Locked-out threads will continue trying to access the lock even if denied.

Which of the following is NOT a characteristic of spinlocks? A: Locked-out threads will stop executing in a busy-waiting mode 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: Best used when the wait time for acquiring a lock is expected to be very short

Locked-out threads will stop executing in a busy-waiting mode

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

Main Memory

Which of the following describes Simple Paging? A: Main memory is divided into a number of equal-sized frames. Processes are divided into equal-sized pages the same length as the frames and then loaded. B: Partitions are created during run-time and processes are loaded into same-sized partitions. C: Main memory is divided into static partitions at system generation time. A process is then loaded into a partition that is equal size or larger. D: Each process is divided into segments. The segments are loaded into not-necessarily-contiguous dynamic partitions.E: Processes and memory are sized at random and match together through the power of friendship.

Main memory is divided into a number of equal-sized frames. Processes are divided into equal-sized pages the same length as the frames and then loaded.

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

Memory location that is completely independent

Given an object's status is found to be "read lock" which of the following can be happening to that object. A. A thread is currently writing to that object and preventing other threads from writing 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. Multiple threads are read-only accessing that object.

Multiple threads are read-only accessing that object.

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

Mutual Exclusion

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

Mutual exclusion, hold and wait, no pre-emption, and circular wait

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. Next-fit B. Best-fit C. First-fit D. Worst-fit E. Buddy System

Next-fit

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

No internal fragmentation

What table is used to keep track of each process's page allocation? A. I/O Table B. Memory Table C. Page Table D. File Table E. Truth Table

Page Table

What is the paging method? A: Partition memory into equal fixed-size chunks that are relatively small 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 not equal fixed-size chunks that are relatively big

Partition memory into equal fixed-size chunks that are relatively small

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 zero.

Past value of the semaphore.

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

Pause all processes and run each one sequentially

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

Preemption

Which of the following is a method of deadlock avoidance? A. Process Initiation Denial - stating max resource requirements for each process in advance and having a fixed number of processes to allocate. B. Mutual exclusion - allowing resource access to one process at a time. C. 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. 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.

Process Initiation Denial - stating max resource requirements for each process in advance and having a fixed number of processes to allocate.

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. Sharing C. Protection D: Logical organization E: Physical organization

Protection

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

Request, Use, Release

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

SIGSYS

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

Safe State

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

Set bit nr in the bitmap pointed to by addr; return the old bit value

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

Vector

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

Wait-for

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

Wasted space due to the block of data loaded being smaller than the partition.

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 condition in which a thread continuously attempts an action that fails

What is the definition of a request edge? A. A set of methods intended to ensure that at least one of the necessary conditions for deadlock cannot hold. B. directed graph for precise description of deadlocks. C. In a system resource-allocation graph, an edge (arrow) indicating a resource assignment. D. In a system resource-allocation graph, an edge (arrow) indicating a resource request.

directed graph for precise description of deadlocks.

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: int atomic_sub_and_test(int i, atomic_t *v) B: void atomic_sub(int i, atomic_t *v) C: void atomic_dec(atomic_t *v) D: int atomic_dec_and_test(atomic_t *v) E: int atomic_sub_and_test(atomic_t *v, int i)

int atomic_sub_and_test(int i, atomic_t *v)

Which of the following is not involved in the interaction between databases and deadlocks? A. Victims B. Transactions C. Locks D. request matrices E. Wait-for graph

request matrices

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: 64 Pages B: 10 Pages C: 6 Pages D: 1024 Pages E: 1 Page

64 Pages

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 avoid deadlocks by checking if allocating resources will result in a 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 recover from 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.

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.

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

A variable-length block of data in secondary memory

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.

Aborting one of the processes in the circular wait

Which of the following statements about deadlocks is true? A. An unsafe state cannot 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 may lead to a deadlock

An unsafe state may lead to a deadlock

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

Causes internal fragmentation

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. Circular Wait C. Hold and Wait D. Mutual Exclusion E. No preemption

Circular Wait

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

Cooperation

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

Deny circular wait

Which of the following is not a method of deadlock prevention? A. Linear Ordering of resource types B. Some resources must not be shared between requests C. Deny the start of a process if deadlock conditions met D. denial of further request requires request of resources E. request one resource at a time with simultaneously granted requests

Deny the start of a process if deadlock conditions met

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

External fragmentation

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

Force fit

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

Fragmentation will occur as a result of segmentation.

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

Frequent checks consume considerable processor time

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

Give each processes unlimited CPU resources so every process has sufficient resources

What is one method by which a livelock can typically be avoided? A: Have each thread retry the failing operation at random times 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: Ignore the potential for a livelock to occur in the system

Have each thread retry the failing operation at random times

What are the differences between livelock and deadlock? A: 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. B: 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. 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.

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.

What are the two main methods of deadlock prevention? A: Indirectly by preventing the occurrence of one of the three necessary conditions, and directly by preventing the occurrence of a circular wait. B: Indirectly by preventing the occurrence of one of the three necessary conditions, and directly by preventing the occurrence of mutual exclusion. C: Indirectly by preventing the occurrence of one of the three necessary conditions, and directly by preventing the occurrence of a hold-and-wait. D: Indirectly by preventing the occurrence of one of the four necessary conditions, and directly by preventing the occurrence of a no pre-emption. E: Indirectly by preventing the occurrence of one of the four necessary conditions, and unintentionally by accidentally realizing you prevented a deadlock later.

Indirectly by preventing the occurrence of one of the three necessary conditions, and directly by preventing the occurrence of a circular wait.

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

Inefficient use of memory due to internal fragmentation; maximum number of active processes is fixed.

Which of the following is not a resource that is reusable? A. I/O Channels B. Main memory C. Information in I/O buffers D. semaphores E. files

Information in I/O buffers

Which of the following is an advantage to deadlock avoidance? A. It is less restrictive than deadlock prevention. B. it maximized the resource requirement for each process. C. A process may exit while holding resources. D. There can be a fixed number of resources to allocate.

It is less restrictive than deadlock prevention.

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

It is necessary to preempt and rollback processes

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. The state is not a state B. It is safe. C. It will never lead to a deadlock. D. The state cannot be determined. E. It is unsafe

It is unsafe

What does the UNIX do for messages? A. It sends out the output command of a program to be processed B. It provides the memory allocation for messaging C. It provides the msgsnd and msgrcv system calls for processes to engage in passing D. It doesnt do anything for messages. E. It helps secure the transmission of data.

It provides the msgsnd and msgrcv system calls for processes to engage in passing

Which of the following is not one of the four conditions that will make a deadlock situation arise? A. Circular Wait B. Mutual Exclusion C. Hold and wait D. No preemption E. Livelock

Livelock

If Relocatable Code is generated then at what stage is Final Binding of where in memory the process resides completed? A. Compile Time B. Interrupt Binding C. Execution Time D. Load Time E. Logical Address

Load Time

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

Simple Segmentation

Which of the following is incorrect about the Buddy System? A: Suppose we are freeing block B. When we release block b, if its neighboring blocks are free, we can always combine B with them. 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: Internal fragmentation is a result of the buddy system

Suppose we are freeing block B. When we release block b, if its neighboring blocks are free, we can always combine B with them.

How are deadlock prevention and fire extinguishers the same? A. They both hurt if you get one thrown at you B: They both stop the problem by shutting down all conditions of the problem. C: You need them to avoid a deadlock/fire. D: They can stop a deadlock/fire without removing any of the conditions. E. They both remove a condition of a deadlock/fire to prevent it.

They both remove a condition of a deadlock/fire to prevent it.

Which is NOT a condition for deadlock? A. Circular Wait B. Mutual Exclusion C. Hold and Wait D. Total Recall E. No preemption

Total Recall


Ensembles d'études connexes

Legitimacy & Sources of Authority

View Set

Chapter 1: Introduction to Networking

View Set

CISM - Information Security Governance Flash

View Set

Chemistry Chapter 3 Practice questions

View Set

Biology Exam #2 - Mutualistic Interactions

View Set