CSCI 4011 Exam 2

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

D. Ready

A process that consumes all of its CPU time allocation moves to this queue. A. Run B. Job C. Event D. Ready E. Resource

True

A program may contain more than one critical sections. True or False

True

Deadlock cannot occur within an Operating System that use a deadlock prevention method. True or False

False

Deadlock exists within a system or processes and resources when one or more cycles are identified within a Resource Allocation Graph. True or False

D. Bakery algorithm

Dr. Leslie Lamport is the author of which one of the following algorithms? A. Shortest Job Next algorithm B. Mac & Tosh algorithm C. First Come First Served algorithm D. Bakery algorithm E. Producer and Consumer algorithm

Must have 2 or more active processes and 2 or more processors

Explain what is required for simultaneous program execution to occur.

P4

Given the states of ten (10) processes as they execute a program with a critical section where access is controlled using the Bakery algorithm. Process P4 and P8 have the same number. Which process will gain access to the critical section first?

B. The 8 processes that want to enter their critical sections decide

If a Multiple Program (i.e. Multiprogramming ) Operating System currently supports 15 processes, and 8 of those processes want to enter their critical section, then what processes determine which one of the 8 processes can enter their critical section? A. The 7 processes that do not want to enter their critical sections decide B. The 8 processes that want to enter their critical sections decide C. All 15 processes decide D. The operating system decides E. A random process decides

7, 102

If a process requires 1398 CPU cycles of time to complete execution and the Operating Systems CPU time slice is set to be 216 cycles, then the Operating System will allocate the CPU to the process _____ times. The process will use _____ CPU cycles of time during its last CPU allocation.

6, 670

If a process requires 5120 CPU cycles of time to complete execution and the Operating Systems CPU time slice is set to be 890 cycles, then the Operating System will allocate the CPU to the process _____ times. The process will use _____ CPU cycles of time during its last CPU allocation.

False

If lock == false, then TestAndSet(lock) returns true. True or False

False

Jobs more frequently request the CPU in large increments rather than in small increments. True or False.

True

Jobs that reside in the job queue are not allocated resources. True or False.

B. 12

Let us assume a job entered the Operating System at time 5, exited the Operating System at time 32, and its wait time is 15. Which one of the following represents the job's CPU burst? A. 22 B. 12 C. 17 D. 10 E. 42

TAT = 15 WT = 6

Let us assume a process enters the Operating System at time 7 and exits the Operating System at time 22. Let us also assume the process's CPU burst is 9. In the space provided, calculate the process' turn around time and wait time.

Need A : 4 Need B: 3 Need C: 1

Let us assume a process requires 10 units of resource A, 5 units of resource B, and 2 units of resource C to complete the execution of its assigned program. Let us also assume the process has currently been allocated 6 units of resource A, 2 units of resource B, and 1 unit of resource C. In the spaces provided, write the three numbers that represent the process' resource A, B, and C need.

10

Let us assume a process requires 345 milliseconds of CPU time to complete execution and the Operating System uses a CPU time-slice of 35 milliseconds. How many times must the process be allocated the CPU by the Operating System before it completes execution?

E. Three units

Let us assume an Operating System manages twenty units of a resource. If process A holds five units, process B holds eight units, and process C holds four units, then how many units are available for future allocation by the Operating System? A. Eight units B. Sixteen units C. Seven units D. Eleven units E. Three units

True

Let us assume an Operating System's job queue is organized as a multilevel feedback queue system. As a result, the Operating System can move a job currently in job queue i downward into job queue i-1. True or False.

D. mutex will be decremented by one

Let us assume mutex == 1. Which one of the following actions will occur when the CPU executes the instruction wait(mutex)? A. mutex will be incremented by one B. mutex will be assigned the value 1 C. No action will occur because lock == false D. mutex will be decremented by one E. mutex will be assigned the value 0

D. flag[1] == false OR turn == 0

Let us assume process 0 and process 1 both use the Mac & Tosh algorithm. Which one of the following conditions, when true, will allow process 0 to enter its critical section if it has indicated it wants to do so? A. flag[0] == false OR turn == 1 B. flag[0] == true OR turn == 0 C. flag[0] == true AND turn == 1 D. flag[1] == false OR turn == 0 E. flag[1] == true AND turn == 1

D. flag[0] = false

Let us assume process 0 and process 1 both use the Mac & Tosh algorithm. Which one of the following program instructions must process 0 execute to let process 1 know that it intends to enter its remainder section? A. flag[1] = true B. turn = 0 C. flag[1]= true AND turn = 0 D. flag[0] = false E. turn = 1

D. 2

Let us assume process A enters the Operating System at time 4, exits the Operating System at time 11, and has a CPU burst of 5. Which one of the following expressions represents the processes wait time? A. 4 B. 8 C. 16 D. 2 E. 14

D. 11 - 4 - 5

Let us assume process A enters the Operating System at time 4, exits the Operating System at time 11, and has a CPU burst of 5. Which one of the following expressions represents the processes wait time? A. 4 + 11 - 5 B. 5 + 4 + 11 C. 11 + 5 - 4 D. 11 - 4 - 5 E. 11 - 5 + 3

E. 12

Let us assume process B exits the Operating System at time 13, has a CPU burst of 7, and has a wait time of 5. Which one of the following numbers represents the processes turn around time? A. 5 B. 2 C. 35 D. 7 E. 12

Process P1 must set its flag to true (i.e. flag[1] == true). Process P1 must then set the shared variable turn to 0 (i.e. turn == 0).

Let us assume two processes, P0 and P1, are executing programs that use the Mac & Tosh algorithm to control access to a critical section. Explain what process P1 must do to inform process P0 it wants to enter the critical section.

E. Mac & Tosh Algorithm

Let us assume you are asked to write two programs that concurrently update a database table. Which one of the following algorithms would be the best to use when writing your programs? A. Safety Algorithm B. Banker's Algorithm C. Bakery Algorithm D. Round Robin Algorithm E. Mac & Tosh Algorithm

Any solution to the critical section problem must address three properties: (1) Mutual Exclusion, (2) Progress, and (3) Bounded Waiting. Semaphores represent only a partial solution to the critical section problem because they fail to address the Bounded Waiting property.

Let us assume you are employed by the ABC Corporation as a junior system administrator. As before, you are eating lunch in the company's commissary and the same work colleague you ate lunch with last week says they solved a critical section problem they identified in several programs by using semaphores. How do you respond to your colleague's statement?

B. Before any processes number[i] reaches the largest positive integer, all processes must execute in their remainder sections at the same time

The Bakery algorithm has one fatal flaw. Which one of the following actions will allow the algorithm to execute forever without failure? A. Two or more processes must obtain the largest possible integer as their number[i] B. Before any processes number[i] reaches the largest positive integer, all processes must execute in their remainder sections at the same time C. At some time in the future, while all processes choosing[i] are false, every process must decide to enter the critical section D. One processes number[i] must always be zero E. One process must always be executing in the critical section

A. First Come First Served

The Round Robin CPU scheduling algorithm functions in a manner similar to this CPU scheduling algorithm when it uses a large time slice. A. First Come First Served B. Priority Preemptive C. Deadline Non-Preemptive D. Shortest Job Next Preemptive E. Shortest Job Next Non-Preemptive

B. Jobs with smaller CPU bursts

The Shortest Job Next Preemptive CPU scheduling algorithm favors these types of jobs. A. Jobs with CPU burst equivalent to the time slice B. Jobs with smaller CPU bursts C. Jobs with smaller enter times D. Jobs with larger priorities E. Jobs with larger CPU bursts

D. The degree of multiprogramming

The long term CPU scheduler controls this aspect of the Operating System. Select one: A. The time a jobs waits to gain access to a resource B. How often a job enters the ready queue C. When a CPU intensive job gains access to the CPU D. The degree of multiprogramming E. How many jobs enter the operating system during a given time period

E. Ready Queue → Job Queue

The medium term CPU scheduler is responsible for moving jobs that reside in the __________ to the __________. A. Job Queue → Event Queue B. Job Queue → Running State C. Ready Queue → Running State D. Event Queue → Ready Queue E. Ready Queue → Job Queue

E. Swapping

The medium term CPU scheduler is responsible for this type of scheduling. A. Slicing B. Thrashing C. Rotating D. Cycling E. Swapping

False

The only way for a job to enter the job queue is when it is newly created. True or False

E. Ready Queue → Running State

The short term CPU scheduler is responsible for moving jobs that reside in the __________ to the __________. A. Job Queue → Ready Queue B. Ready Queue → Event Queue C. Job Queue → Running State D. Ready Queue → Job Queue E. Ready Queue → Running State

The degree of multiprogramming

The total number of user processes and Operating System processes that have been allocated memory at any given time is referred to what?

A. Deadline

This CPU scheduling algorithm functions in a manner similar to the Priority CPU scheduling algorithm. A. Deadline B. Round Robin C. First Come First Served D. All algorithms listed function in a manner similar to the Priority CPU scheduling algorithm E. Shortest Job Next

C. Round Robin

This CPU scheduling algorithm is most often used by modern Operating Systems. A. First Come First Served B. Shortest Job Next C. Round Robin D. Deadline E. Priority

E. The number of processes loaded in computer's memory

This represents the degree of multiprogramming A. The number of jobs that enter the Operating System B. The time a job spends in the Operating System C. The amount of time a process spends using the CPU D. The amount of time a process spends waiting to use the CPU E. The number of processes loaded in computer's memory

D. Starvation

This situation occurs anytime a process makes a request to enter its critical section, but is never granted access. Select one: A. Synchronization B. Failure C. Deadlock D. Starvation E. Exclusion

D. First Come First Served CPU scheduling begins.

This situation occurs when the Round Robin CPU scheduling algorithm uses a very large CPU time slice. A. CPU utilization increases. B. More jobs are moved from the Job Queue into the Ready Queue. C. Turn Around Time decreases. D. First Come First Served CPU scheduling begins. E. More jobs exit the Operating System in a time period.

E. Each represent a finite resource

What do printers, memory, CPU, hard disks, and tape drives have in common? A. Each can be allocated to multiple processes simultaneously B. Each represent a space multiplexed resource C. Each can be allocated to multiple processes sequentially D. Each represent a time multiplexed resource E. Each represent a finite resource

D. Request

What does label D represent in the Resource Allocation Graph shown below? A. Process B. Allocation C. Resource D. Request E. Time Slice

B. Simultaneous program execution

What is shown in the diagram? A. Synchronous program execution B. Simultaneous program execution C. Batch program execution D. Concurrent program execution E. Parallel program execution

A job in the job queue has no resources allocated and no process exists to execute the program associated with the job.

What is the primary difference between a job in the ready queue and a job in the job queue?

B. 37

What is the turn-around time for a process that requires 19 CPU bursts of service, enters the ready queue at time stamp 6, and waits 18 CPU bursts for service. A. 30 B. 37 C. 28 D. 13 E. 24

A. When a job moves from the Job Queue to the Ready Queue. B. When a job moves from the Ready Queue to the Job Queue.

When does swapping occur? Select one or more: A. When a job moves from the Job Queue to the Ready Queue. B. When a job moves from the Ready Queue to the Job Queue. C. When a job moves from the Running State to the Block-Waiting Queue. D. When a job moves from the Ready Queue to the Running State. E. When a job moves from the Running State to the Ready Queue. F. When a job moves from the Block-Waiting Queue to the Ready Queue.

The buffer will eventually become full forcing the producer to wait for the consumer

When using a bounded buffer, what will eventually occur when a producer is able to produce data faster than a consumer can consume the data?

D. Hard Disk Drive

Where does the Operating System store jobs that reside in the job queue? A. Flash Memory B. Read Only Memory C. Random Access Memory D. Hard Disk Drive E. Tape Drive

The Long-term CPU scheduler

Which CPU scheduler is responsible for selecting jobs that currently reside in the job queue and placing them in the ready queue?

CPU Utilization

Which Operating System CPU scheduling goal is highlighted by the statement one-hundred (100) processes were able to gain access to the CPU during the last one-hundred (100) microseconds?

A. Priority C. Deadline E. Shortest Job Next

Which of the following CPU scheduling algorithms has both a preemptive and a non-preemptive variant? Select all that apply. Select one or more: A. Priority B. Round Robin C. Deadline D. First Come First Served E. Shortest Job Next

A. Deadline B. Priority E. Shortest Job Next

Which of the following CPU scheduling algorithms have both a preemptive and non-preemptive variant? Select all that apply. A. Deadline B. Priority C. Round Robin D. First Come First Served E. Shortest Job Next F. No CPU scheduling algorithm has both a preemptive and non-preemptive variant

A. Mutual Exclusion B. No Preemption C. Circular Wait D. Hold and Wait

Which of the following are present in the Deadlock situation shown in the figure below? Select all that apply. P3 → R7 → P5 → R4 → P8 → R1 → P3 A. Mutual Exclusion B. No Preemption C. Circular Wait D. Hold and Wait E. Progress F. Bounded Wait

A. Writing data to a file B. Writing data to a database table C. Deleting data from a file F. Assigning a value to a shared variable

Which of the following program actions represent critical sections? Select all that apply. A. Writing data to a file B. Writing data to a database table C. Deleting data from a file D. Reading data from a file E. Reading data from a database table F. Assigning a value to a shared variable

A. P4 ---> R9 C. P2 ---> R7

Which of the following represent a Resource Allocation Graph request edge? Select all that apply. A. P4 ---> R9 B. R2 ---> P6 C. P2 ---> R7 D. P3 ---> P8 E. R1 ---> R2 F. R7 ---> P5

A. None represent characteristics of the long-term scheduler.

Which of the following represent a characteristics of the long-term CPU scheduler? A. None represent characteristics of the long-term scheduler. B. Moves jobs from the Ready Queue to the Job Queue. C. Controls the Operating System's CPU time slice duration. D. Executes N times every second. E. All represent characteristics of the long-term scheduler.

A. No Preemption D. Circular Wait E. Hold and Wait

Which of the following represent deadlock conditions. Select all that apply. A. No Preemption B. Progress C. Bounded Wait D. Circular Wait E. Hold and Wait

A. Decrease in process throughput D. Decrease in CPU utilization

Which of the following represent disadvantages associated with using a non-preemptive CPU scheduling algorithm? Select all that apply. A. Decrease in process throughput B. Increase in CPU scheduling algorithm complexity C. Increase in the number of context switches D. Decrease in CPU utilization E. Decrease in system response time F. Increase in number of jobs loaded into memory

B. Mutual Exclusion C. Progress D. Bounded Wait

Which of the following represent properties any solution to the critical section problem must satisfy? Select all that apply. A. Hold and Wait B. Mutual Exclusion C. Progress D. Bounded Wait E. No Preemption F. Circular Wait

E. wait() F. signal()

Which of the following represent standard semaphore system calls? Select all that apply. A. test() B. lock() C. key() D. set() E. wait() F. signal()

E. mutex

Which of the following represent the semaphore shared variable a process must obtain, or secure, before entering its critical section? A. key B. lock C. latch D. test E. mutex

A. If some processes and resources are deadlock, then all of the conditions of deadlock are present B. If one of the conditions of deadlock is not present, then the system of processes and resources is not deadlocked

Which of the following statements are true regarding deadlock? Select all that apply. A. If some processes and resources are deadlock, then all of the conditions of deadlock are present B. If one of the conditions of deadlock is not present, then the system of processes and resources is not deadlocked C. If one process and one resource are deadlocked, then only one of the conditions of deadlock is present D. If a system of processes and resources is not deadlocked, then all of the conditions of deadlock are not present E. If all of the conditions of deadlock are present, then the system of processes and resources is deadlocked

B. flag[] D. turn

Which of the following variables will the algorithm for the two process critical section problem use to determine which of the two processes will gain access to the critical section next? Choose all that apply A. status[] B. flag[] C. choosing[] D. turn E. number[]

A. Round Robin

Which one of the following CPU scheduling algorithms is essentially the First Come First Served CPU scheduling algorithm with a time slice? A. Round Robin B. Deadline C. Shortest Job Next D. Priority E. Longest Job First

D. Utilization

Which one of the following Operating System performance metrics represents how busy a resource is within a given time interval? Select one: A. Wait Time B. Response Time C. Turn Around Time D. Utilization E. Throughput

E. Throughput

Which one of the following Operating System performance metrics represents the amount of work accomplished within a given time interval? A. Utilization B. Turn Around Time C. Wait Time D. Response Time E. Throughput

C. Response Time

Which one of the following Operating System performance metrics represents the time between when a process is started and when the CPU begins executing the process and generates output? A. Turn Around Time B. Utilization C. Response Time D. Throughput E. Wait Time

A. request

Which one of the following arrays is not used by the Safety algorithm? A. request B. allocation C. work D. need E. finish

D. Edsger Dijkstra

Which one of the following computing pioneers defined the theoretical concept of semaphores? A. Leslie Lamport B. Robert Kahn C. Alan Turing D. Edsger Dijkstra E. Marvin Minsky

B. Bounded Wait

Which one of the following does not represent a condition for deadlock? A. Mutual Exclusion B. Bounded Wait C. Circular Wait D. Hold and Wait E. No Preemption

D. A process is allocated a resource by the Operating System.

Which one of the following does not represent a situation in which the short-term scheduler will be invoked. A. A process finishes execution of the last program instruction. B. A process issues a system call to request a resource. C. A process' time slice expires. D. A process is allocated a resource by the Operating System. E. A process issues a system call to wait for an event to occur.

E. Object

Which one of the following does not represent an Operating System queue? Select one: A. Event B. I/O Device C. Ready D. Job E. Object

C. Time Exit - Time Enter

Which one of the following expressions represents turn around time? A. Wait Time + CPU Burst B. CPU Burst - Time Exit C. Time Exit - Time Enter D. CPU Burst - Elapsed Time E. Time Enter + Priority

D. R7 ← P1

Which one of the following represents a Resource Allocation Graph request edge? A. P6 ← P2 B. P8 → P5 C. R3 ← R5 D. R7 ← P1 E. R0 → P4

D. More context-switches occur

Which one of the following represents a characteristic of preemptive CPU scheduling? A. Preemptive CPU scheduling is fairly simple to implement B. Job throughput decreases C. Larger time slices are required D. More context-switches occur E. CPU utilization is minimized

E. Atomic operation

Which one of the following represents a computer operation that must be performed entirely, as one uninterruptible operation? A. Arithmetic operation B. Interactive operation C. Concurrent operation D. Transaction operation E. Atomic operation

A. Mutual Exclusion

Which one of the following represents both a critical section property and a deadlock condition? A. Mutual Exclusion B. No Preemption C. Hold and Wait D. Bounded Waiting E. Progress

C. Progress

Which one of the following represents the Critical Section property that ensure the decision as to which process will gain access to its critical section will not be postponed indefinitely. Select one: A. Mutual Exclusion B. No Preemption C. Progress D. Bounded Waiting E. Declaration

B. Bounded Waiting

Which one of the following represents the Critical Section property that semaphores fail to address. A. Mutual Exclusion B. Bounded Waiting C. Progress D. No Preemption E. Hold and Wait

A. A process continuously checks a computer resource's status register to determine if it is busy, or not.

Which one of the following statements best describes the busy-wait method? A. A process continuously checks a computer resource's status register to determine if it is busy, or not. B. The main memory unit waits for a busy hard disk drive to write data. C. A job remains in the Block-Waiting Queue waiting to be allocated a requested resource by the Operating System. D. The medium-term scheduler returns a job to the Job Queue to wait for a resource. E. A computer resources sends a signal to the Operating System stating it is working to complete an assigned task.

C. Some process is executing in the critical section

Which one of the following statements is correct when TestAndSet(lock) returns true. A. All processes are executing in the remainder section B. Two or more processes would like to enter the critical section C. Some process is executing in the critical section D. Some process has finished execution E. All processes are executing in the critical section

E. The Operating System will update fewer process control blocks over time

Which one of the following statements is not true with respect to short time slices. A. The Operating System will execute the short-term scheduler more often over time. B. Small CPU burst jobs will, on average, exit the Operating System sooner. C. A job in the Ready Queue will, on average, gain access to the CPU sooner. D. A job will execute fewer program instructions during its time slice. E. The Operating System will update fewer process control blocks over time

E. The number of jobs that exit the Operating system in a time period.

Which one of the following statements represents job throughput? A. The elapsed time between when a job begins and when the job ends. B. The amount of time a job spends in the Ready Queue. C. The time between when a job enters the Operating System and when the CPU executes the job's first program instruction and generates output. D. The number of jobs that use the CPU in a time period. E. The number of jobs that exit the Operating system in a time period.

E. Throughput

Which one of the following system performance metrics specifies the amount of work accomplished in a given time interval? A. Response Time B. CPU Utilization C. Fairness D. Turn-Around Time E. Throughput

C. Simple

Which one of the following terms best describes the First Come First Served CPU scheduling algorithm? Select one: A. Greedy B. Approximate C. Simple D. Preemptive E. Complex

D. Reactive

Which one of the following words best describes Deadlock Recovery? A. Trivial B. Anticipatory C. Preemptive D. Reactive E. Efficient

B. They do not prevent critical section starvation from occurring

Why are semaphores considered a partial solution to the critical section problem? A. They permit two or more processes to set the lock simultaneously to false B. They do not prevent critical section starvation from occurring C. They represent a software solution versus a hardware solution D. They allow two or more processes to decide who gains access to the critical section E. They fail to ensure mutual exclusion

C. To determine whether or not a system of processes and resources is in a safe state

Why would an Operating System use the Safety Algorithm? A. To determine whether a resource can be preempted from more than one process B. To allow resources to be fairly allocated among two or more processes C. To determine whether or not a system of processes and resources is in a safe state D. To determine whether granting a processes' resource request will leave the system in a safe state E. To allow two or more processes to share two or more resources

False

With respect to deadlock avoidance, if the current state of the operating system is unsafe, then all processes are deadlocked. True or False

E. checking every request for any resource by all processes

With respect to deadlock avoidance, the Operating System ensures the system of process and resources remains safe by __________. A. making sure only one process holds all the units of any resource B. computing the time each process must remain in the system before it terminates C. periodically creating a resource allocation graph D. ensuring that a process does not hold more units of a resource than any other process E. checking every request for any resource by all processes

A. It must ensure a process does not hold other resources whenever it requests a resource

With respect to deadlock prevention, what must the Operating System do to ensure the hold and wait condition never holds (i.e. is never true)? A. It must ensure a process does not hold other resources whenever it requests a resource B. It must ensure a process holds a resource or resources C. It must ensure a resource is never requested by two or more processes D. It must ensure a resource can be allocated to any process that is not holding other resources E. It must ensure a resource is allocated to only one process

C. The process with the smallest process identifier number gains access to the critical section first

With respect to the Bakery algorithm, how are ties broken when two or more processes receive the same entry number? A. The processes attempt to terminate each other, with the survivor gaining access to the critical section first B. All process with the same number will gain access to the critical section simultaneously C. The process with the smallest process identifier number gains access to the critical section first D. The operating system randomly assigns new numbers to the processes E. The operating system immediately terminates all processes who receive the same number

If all processes are executing in their remainder sections, then number[i] == 0 and choosing[i] == false for all i.

With respect to the Bakery algorithm, what must be true if all processes are executing in their remainder sections?

D. counter == 0

With respect to the Producer and Consumer algorithm, which one of the following conditions, when true, will direct the consumer to wait for the producer to produce another piece of data and place it in the buffer. A. (in - out) == N B. nextc == buffer[out] C. out == (in + 1) % N D. counter == 0 E. (out - in) == counter

C. N

With respect to the producer and consumer problem, which one of the following variables or expressions represents the size of the buffer? A. in + out + N B. counter C. N D. in - out E. counter + in

True

With respect to the safety algorithm, more than one safe sequence may exist within a system of processes and resources. True or False

C. 3

With respect to the safety algorithm, what is allocation[2][4] when need[2][4] == 5 and max[2][4] == 8? A. True B. False C. 3 D. 13 E. 6

False

Within a Multiple Program (i.e. Multiprogramming ) Operating System, all processes execute concurrently and synchronously. True or False.


Ensembles d'études connexes

ITP 408 [design thinking & innovation]

View Set

APUSH Chapter 6: A Revolution, Indeed, 1774-1783

View Set

InfoTech (Computer Worms and Viruses)

View Set

English Final Exam A Good Man is Hard to Find by Flannery O' Connor

View Set

Chapter 12: Dietary Supplements (Questions-2)

View Set

BUS1B Managerial Accounting Chapter 2

View Set

Lifestyle disease & Risk factors (Sheltered)

View Set

Strategic Management: Business Models: Test 2

View Set