review questions second test

25
Chapter 5 Section 5.1 5.1 Threads that operate independently of one another but must occasionally interact to perform cooperative tasks are said to execute ________. a) synchronously b) in parallel c) asynchronously d) simultaneously Section 5.2 5.2 Preventing more than one thread from accessing a shared variable simultaneously is known as ________ access to the shared variable. a) excluding b) synchronizing c) serializing d) protecting 5.3 ________ restricts access to a shared variable to only one thread at any given time. a) asynchronism b) serialization c) protection d) mutual exclusion Section 5.2.1 5.4 An example of a producer/consumer relationship is ________. a) an application that copies data from a fixed-size buffer to a CD-RW b) a word processor that sends data to a buffer to be printed c) both a and b d) none of the above 5.5 In Java, Object method notify transitions a thread from the ________ state to the ________ state. a) waiting, ready b) blocked, waiting c) running, waiting d) ready, running 5.6 In Java, the sleep method call must appear in part of a ________ statement because it might throw an exception indicating that the thread was interrupted before its sleep time expired. a) if...else b) do...while c) try...catch d) switch

Upload: maha-tarek

Post on 24-Oct-2014

195 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Review Questions Second Test

Chapter 5

Section 5.1

5.1 Threads that operate independently of one another but must occasionally interact to perform cooperative tasks are

said to execute ________.

a) synchronously

b) in parallel

c) asynchronously

d) simultaneously

Section 5.2

5.2 Preventing more than one thread from accessing a shared variable simultaneously is known as ________ access to

the shared variable.

a) excluding

b) synchronizing

c) serializing

d) protecting

5.3 ________ restricts access to a shared variable to only one thread at any given time.

a) asynchronism

b) serialization

c) protection

d) mutual exclusion

Section 5.2.1

5.4 An example of a producer/consumer relationship is ________.

a) an application that copies data from a fixed-size buffer to a CD-RW

b) a word processor that sends data to a buffer to be printed

c) both a and b

d) none of the above

5.5 In Java, Object method notify transitions a thread from the ________ state to the ________ state.

a) waiting, ready

b) blocked, waiting

c) running, waiting

d) ready, running

5.6 In Java, the sleep method call must appear in part of a ________ statement because it might throw an exception

indicating that the thread was interrupted before its sleep time expired.

a) if...else

b) do...while

c) try...catch

d) switch

Page 2: Review Questions Second Test

Section 5.2.2

5.7 Which of the following statements about critical sections is false?

a) Only one thread at a time can execute the instructions in its critical section for a particular resource.

b) If one thread is already in its critical section, another thread must wait for the executing thread to exit its critical

section before continuing.

c) Once a thread has exited its critical section, a waiting thread may enter its critical section.

d) All threads must wait whenever any critical section is occupied.

5.8 Code inside a critical section should ________.

a) access shared, modifiable data

b) run as quickly as possible

c) prevent the possibility of infinite loops

d) all of the above

Section 5.2.3

5.9 The constructs that encapsulate a thread’s critical section are sometimes called ________.

a) critical section primitives

b) synchronism delimiters

c) mutual exclusion primitives

d) protection delimiters

Section 5.3

5.10 Which property of mutual exclusion primitives is inappropriate for multiprocessor systems?

a) The solution is implemented purely in software on a machine without specially designed mutual exclusion

machine-language instructions.

b) No assumption can be made about the relative speeds of asynchronous concurrent threads.

c) A thread that is executing instructions outside its critical section cannot prevent any other threads from entering

their critical sections.

d) A thread must not be indefinitely postponed from entering its critical section.

Section 5.4

Section 5.4.1

5.11 A thread that uses processor cycles to continually test a condition before entering its critical section is said to be

________.

a) lockstep synchronized

b) deadlocked

c) busy waiting

d) indefinitely postponed

5.12 Lockstep synchronization does not ________.

a) occur when threads must enter and leave their critical sections in strict alternation

b) improve the efficiency of a process by forcing threads to operate at the same speed

c) force faster threads to operate at the same speed as slower threads

d) occur as a result of using a single variable to govern access to threads’ critical sections

5.13 ________ occurs when an infinite loop prevents progress in a multithreaded application.

a) Lockstep synchronization

b) Deadlock

c) Busy waiting

d) Indefinite postponement

Page 3: Review Questions Second Test

Section 5.4.2

No questions.

Section 5.4.3

5.14 Lamport’s Bakery Algorithm does not require ________.

a) a large number of shared variables

b) complicated loops

c) that any operations occur atomically

d) all of the above

5.15 Which of the following statements about Lamport’s Bakery Algorithm is false?

a) Lamport’s algorithm allows multiple threads to obtain the same ticket number.

b) The thread possessing the ticket with the highest numerical value can enter its critical section.

c) Lamport’s algorithm enforces mutual exclusion.

d) A thread’s ticket number is reset when the thread exits its critical section.

5.16 Which of the following mutual exclusion algorithms require instructions to be executed atomically?

a) Dekker’s algorithm

b) Peterson’s algorithm

c) Lamport’s algorithm

d) both a and b

Section 5.5

Section 5.5.1

5.17 Disabling interrupts ________.

a) is a viable solution for mutual exclusion in a multiprocessor system

b) on a uniprocessor system could result in an infinite loop causing the system to hang

c) typically prevents a thread from being preempted while accessing shared data

d) both b and c

Section 5.5.2

5.18 A ________ is a variable that governs access to critical sections.

a) primitive

b) lock

c) controller

d) flag

Page 4: Review Questions Second Test

5.19 The test-and-set instruction ________.

a) prevents deadlock

b) prevents indefinite postponement

c) eliminates the possibility that a thread is preempted between reading a value from a memory location and writing a

new value to the memory location

d) none of the above

Section 5.5.3

5.20 Many system architectures support a(n) ________ instruction that enables a thread to exchange the values of two

variables atomically.

a) swap

b) test-and-set

c) semaphore

d) switch

Section 5.6

5.21 Which of the following statements about semaphores is false?

a) A thread performs the P operation after it enters its critical section.

b) A thread performs the V operation before exiting its critical section.

c) Initializing a semaphore sets the value of a protected variable to indicate that no thread is executing its critical

section.

d) Initializing a semaphore creates a queue that stores references to threads waiting to enter their critical sections

protected by that semaphore.

Section 5.6.1

5.22 What happens when a thread calls P( S ) when it wants to enter its critical section, where S is a binary semaphore

set to 1?

a) The thread is allowed to enter its critical section and S is decremented.

b) The thread is blocked and added to a queue of waiting threads.

c) The semaphore is set to 2.

d) none of the above

5.23 Which of the following statements about semaphores is true?

a) P and V operations should be indivisible operations.

b) If several threads attempt a P( S ) operation simultaneously, only one thread should be allowed to proceed.

c) A semaphore implementation should guarantee that threads do not suffer indefinite postponement.

d) all of the above

Section 5.6.2

5.24 Semaphores can be used for each of the following purposes except:

a) to protect access to a critical section

b) to notify the process that an event has occurred

c) to prevent shared variables from getting corrupted

d) to synchronize two or more concurrent threads

Section 5.6.3

5.25 If a thread attempts a P operation when a counting semaphore has been decremented to zero, ________.

a) the thread obtains a resource from the pool and decrements the semaphore to -1

b) the thread obtains a resource from the pool and the semaphore remains equal to 0

c) the thread must wait until a resource is returned to the pool by a V operation

d) the thread returns a resource to the pool and increments the semaphore to 1

Page 5: Review Questions Second Test

Section 5.6.4

5.26 Semaphore operations can be implemented in the kernel of a multiprocessor system by:

a) giving one processor the job of controlling the ready list.

b) controlling access (via busy waiting) to a shared ready list.

c) both a and b

d) none of the above

Page 6: Review Questions Second Test

Chapter 6

Section 6.1

6.1 Which of the following is not a reason why the programming community is so intent on concurrent programming?

a) Concurrent programming enables us to express more natural solutions to problems that are inherently parallel.

b) The true hardware parallelism possible with multiprocessors and distributed systems can only be harnessed through

concurrent programming.

c) Concurrent programs are easier to write, debug, modify and prove correct than sequential programs.

d) Systems such as air traffic control systems, mission-critical systems, and real-time process control systems can

benefit from concurrent programming.

6.2 ________ supports concurrent programming, in addition to many features needed to implement real concurrent

systems.

a) Java

b) Visual Basic .NET

c) Python

d) all of the above

Section 6.2

6.3 ________ is a software architectural technique that improves modularity and facilitates the development of more

reliable software systems.

a) Mutual exclusion

b) Multithreading

c) Information hiding

d) Concurrent programming

6.4 To avoid indefinite postponement, a monitor ________.

a) terminates newly arriving threads when other threads are waiting

b) gives a higher priority to waiting threads than to newly arriving ones

c) terminates waiting threads when new threads arrive

d) gives a higher priority to newly arriving threads than to waiting ones

Section 6.2.1

6.5 Monitors implement ________ between threads of execution.

a) mutual exclusion

b) synchronization

c) both a and b

d) none of the above

6.6 A thread can exit a monitor by ________.

a) completing execution of the code protected by the monitor

b) sleeping inside the monitor

c) waiting on a condition variable

d) both a and c

Section 6.2.2

6.7 Monitor initialization ________.

a) occurs each time a thread returns a resource

b) typically sets a variable indicating that the monitor initially is in use

c) occurs only once, before threads begin using the monitor

d) occurs each time a thread requests access to a resource

Page 7: Review Questions Second Test

Section 6.2.3

6.8 Which of the following statements about using a circular buffer to implement print spooling is false?

a) The despooler thread tends to run at a slower speed than the spooler thread.

b) A circular buffer can “take up the slack” resulting from the mismatch in the speeds of the spooler and despooler

threads.

c) If the system always generates print lines faster than the printer can print them, the buffer will always be full.

d) The spooler thread tends to run at a slower speed than the despooler thread.

6.9 If the producer and consumer work at approximately the same speed, using the circular buffer can ________ the

average speed of the application.

a) decrease

b) have no effect on

c) increase

d) none of the above

Section 6.2.4

6.10 In the readers/writers problem, cascading in readers ________.

a) forces all arriving threads to wait

b) continues until all waiting readers have become active

c) allows waiting readers to become active as soon as another reader finishes

d) all of the above

6.11 ________ is important for preventing indefinite postponement in the readers/writers problem.

a) Giving preference to waiting readers over waiting writers

b) Ensuring that no writer thread is waiting to write when a new reader begins reading

c) Forcing that arriving readers to wait while waiting readers are cascading

d) all of the above

Section 6.3

6.12 Which type of monitor allows a thread inside the monitor to signal that the monitor will soon become available,

but still maintain a lock on the monitor until it exits?

a) signal-and-exit

b) signal-and-wait

c) signal-and-continue

d) signal-and-wake

Page 8: Review Questions Second Test

6.13 In Java, a(n)________ is a queue of threads awaiting entry into a monitor.

a) wait set (or queue)

b) entry set

c) notified set

d) either a or b

6.14 In Java, a(n)________ is a queue of threads waiting to reenter the monitor for an object.

a) wait set (or queue)

b) entry set (or queue)

c) notified set

d) either a or b

6.15 In Java, the ________ method wakes all threads in the entry and wait sets.

a) notify

b) signal

c) notifyAll

d) signalAll

Section 6.4

6.16 In the Java implementation of the producer/consumer relationship, the producer thread remains in the ________

until it is notified by another thread that it may proceed.

a) ready state

b) running state

c) waiting state

d) none of the above

6.17 Methods declared as ________ encapsulate critical sections of a program that can only be occupied by one thread

at a time.

a) static

b) synchronized

c) private

d) protected

Section 6.5

6.18 The size of a circular buffer is important because ________.

a) if the number of buffer slots is too large, threads will wait more often

b) if the number of buffer slots is too small, there would be wasted memory

c) if the number of buffer slots is too small, threads will wait more often.

d) if the number of buffer slots is too large, fewer threads can access the buffer

6.19 Which variable(s) must be shared between threads to implement a producer/consumer relationship using a

circular buffer?

a) variables that maintain read and write buffer locations

b) a variable that maintains a count of occupied buffers

c) a reference to a buffer object that holds data used by the readers/writers and provides access methods

d) all of the above

Page 9: Review Questions Second Test

Chapter 7

Section 7.1

7.1 Deadlock can occur ________.

a) only between two or more threads

b) only on multiprogrammed systems

c) only if resource sharing is allowed

d) none of the above

7.2 Which of the following is not a major area of deadlock research?

a) prevention

b) avoidance

c) recovery

d) none of the above

Section 7.2

7.3 If a process is given the task of waiting for an event to occur, and if the system includes no provision for signaling

that event, then we have ________.

a) one-process deadlock

b) starvation

c) mutual exclusion

d) circular wait

Section 7.2.1

Section 7.2.2

7.4 Most deadlocks in operating systems develop because of the normal contention for _________ .

a) dedicated resources

b) processors

c) main memory

d) device drivers

Section 7.2.3

7.5 ________ is characteristic of deadlocked systems.

a) Starvation

b) Circular waiting

c) Saturation

d) Aging

7.6 To avoid deadlock in spooling systems, a system can ________.

a) provide considerably more space for spooling files than is likely to be needed

b) restrain the input spoolers so that they do not accept additional print jobs when the spooling files approach some

saturation threshold

c) allow printing to begin before the job is completed so that a full, or nearly full, spooling file can begin emptying

while a job is still executing

d) all of the above

Section 7.2.4

7.7 The solution to the Dining Philosophers problem must ________.

a) prevent deadlock

b) prevent starvation

Page 10: Review Questions Second Test

c) ensure mutual exclusion

d) all of the above

Section 7.3

7.8 ________ is a technique that prevents indefinite postponement.

a) Monitors

b) Mutual exclusion

c) Aging

d) Preemption

Section 7.4

7.9 Code that may be changed but is reinitialized each time it is used is said to be ________ .

a) serially reusable

b) reentrant

c) static

d) shared

7.10 ________ code is not modified as it executes and may be shared by several processes simultaneously.

a) Preemptible

b) Dynamic

c) Reentrant

d) Serially reusable

7.11 ________ resources are the kinds that tend to become involved in deadlocks.

a) Preemptible

b) Serially reusable

c) Reentrant

d) all of the above

Section 7.5

7.12 Which of the following is not a condition necessary for deadlock to exist?

a) wait-for condition

b) mutual-exclusion condition

c) circular-wait condition

d) indefinite-postponement condition

Page 11: Review Questions Second Test

Section 7.6

7.13 _______ conditions a system to remove any possibility of deadlocks occurring.

a) Deadlock avoidance

b) Deadlock prevention

c) Deadlock detection

d) Deadlock recovery

7.14 ________ imposes less stringent conditions than deadlock prevention in an attempt to get better resource

utilization while stopping deadlock from occurring.

a) Deadlock avoidance

b) Deadlock detection

c) Deadlock recovery

d) both a and c

Section 7.7

Section 7.7.1

7.15 The strategy of denying the “wait-for” condition ________.

a) prevents deadlock from occurring

b) is commonly implemented

c) leads to poor resource utilization

d) both a and c

Section 7.7.2

7.16 The strategy of denying the “no-preemption” condition could lead to ________.

a) indefinite postponement

b) loss of work

c) poor resource utilization

d) both a and b

Section 7.7.3

7.17 The strategy of denying the “circular-wait” condition ________.

a) is a deadlock prevention technique that promotes portability

b) creates a linear ordering of resources

c) maximizes resource utilization

d) none of the above

Section 7.8

7.18 The system is said to be in an unsafe state if ________.

a) the operating system cannot guarantee that all current processes can complete their work within a finite time

b) the system is deadlocked

c) a thread is indefinitely postponed

d) mutual exclusion has been violated

7.19 Dijkstra’s Banker’s Algorithm requires the system to maintain ________ for each process.

a) a count of the system’s total resources

b) the maximum resources that can be requested

c) the current loan

d) both b and c

Page 12: Review Questions Second Test

Section 7.8.1

7.20 Consider the following system state:

Process Max ( Pi ) Loan ( Pi)

P1 7 2

P2 6 2

P3 7 4

Total resources, t = 11

The system will be in a safe state if ________.

a) process P1 is allocated one additional resource

b) process P2 is allocated two additional resources

c) process P3 is allocated three additional resources

d) process P2 is allocated one additional resource

Section 7.8.2

7.21 An unsafe state implies ________.

a) the existence of deadlock

b) that deadlock will eventually occur

c) that some unfortunate sequence of events might lead to a deadlock

d) none of the above

Section 7.8.3

7.22 Consider the following system state:

Process Max ( Pi ) Loan ( Pi)

P1 7 2

P2 5 2

P3 9 4

Total resources, t = 12

The system will enter an unsafe state if ________.

a) process P1 is allocated one additional resource

b) process P2 is allocated two additional resources

c) process P3 is allocated three additional resources

d) process P2 is allocated one additional resource

Page 13: Review Questions Second Test

Section 7.8.4

7.23 In the Banker’s Algorithm, resource requests that would result in ________ are repeatedly denied until they can

eventually be satisfied.

a) indefinite postponement

b) holding resources while waiting for others

c) unsafe states

d) all of the above

Section 7.8.5

7.24 ________ is a weakness of the Banker’s Algorithm.

a) Allowing the population of processes to vary over time

b) Enabling processes to hold their resources indefinitely

c) Requiring that processes state their maximum needs in advance

d) Enabling the number of resources to fluctuate

7.25 The Banker’s Algorithm ________.

a) can provide better resource utilization than deadlock prevention

b) incurs little overhead

c) is appropriate for real-time systems

d) facilitates applications programming

Section 7.9

7.26 ________ is the process of determining that a deadlock exists and identifying the processes and resources

involved in the deadlock.

a) Deadlock avoidance

b) Deadlock detection

c) Deadlock recovery

d) Deadlock prevention

Section 7.9.1

7.27 In a resource-allocation graph, ________ represent processes and ________ represent resources.

a) circles, squares

b) arrows, circles

c) squares, circles

d) arrows, squares

7.28 In a resource-allocation graph, an arrow points from a ________ to a ________ to indicate that the system has

allocated a specific resource of a specific type to the process.

a) square, large circle

b) square, small circle

c) large circle, square

d) small circle, square

Page 14: Review Questions Second Test

Section 7.9.2

7.29 If a graph can be reduced by all its processes, then ________.

a) there is no deadlock

b) indefinite postponement cannot occur

c) the system is in an unsafe state

d) none of the above

Section 7.10

7.30 To ensure that data in a database remains in a consistent state when deadlocked processes are terminated,

database systems typically perform resource allocations using ________.

a) checkpoints

b) rollback

c) aging

d) transactions

7.31 Which of the following complicates deadlock recovery?

a) It may not be clear that the system has become deadlocked.

b) Most systems do not provide the means to suspend a process indefinitely.

c) The deadlock could involve many processes.

d) all of the above

Section 7.11

7.32 Many of today’s personal computer systems ignore deadlock because ________.

a) the processor time required to check for deadlocks can significantly reduce system performance

b) they do not perform many concurrent operations that could lead to deadlock

c) the number of resources that operating systems must manage is decreasing dramatically

d) all of the above

7.33 Deadlock will continue to be an important area of research in current and future systems because ________.

a) large-scale systems are becoming more oriented toward asynchronous parallel operations

b) small, portable devices, for which users cannot rely on an administrator to detect and rid a system of deadlock, are

becoming more prevalent

c) there is an increasing tendency of operating systems designers to view data as a resource that must be managed

carefully

d) all of the above

Page 15: Review Questions Second Test

Chapter 9

Section 9.1

9.1 ________, while plentiful, is slower than other forms of storage and not suitable for running programs.

a) main memory

b) cache

c) secondary storage

d) All of the above

9.2 Which of the following statements is false?

a) Secondary storage cannot be referenced directly by a processor.

b) Some systems cannot afford the overhead of virtual memory.

c) Real memory management is unimportant in today’s systems.

d) Most of today’s systems are virtual memory systems.

Section 9.2

9.3 Operating systems can divide main memory into portions called ________ so that one process cannot overwrite

another’s memory, either inadvertently or maliciously.

a) sections

b) partitions

c) modules

d) regions

Section 9.3

9.4 A memory manager’s primary function is ________.

a) to determine how to allocate available memory

b) to determine how to respond to changes in a process’s memory usage

c) to interact with special memory management hardware

d) all of the above

Section 9.4

9.5 According to ________, many processes that access data and instructions once are likely to access them again in

the future.

a) access patterns

b) Moore’s Law

c) spatial locality

d) temporal locality

9.6 Going from lower to higher levels in the memory hierarchy, ________.

a) storage access time decreases

b) storage cost per bit increases

c) storage capacity increases

d) both a and b

Page 16: Review Questions Second Test

Section 9.5

9.7 ________ strategies determine which pieces of data to remove from main memory to free space for a new process.

a) Fetch

b) Placement

c) Replacement

d) both a and c

9.8 ________ strategies attempt to load a piece of program or data into memory before it is referenced.

a) Demand fetch

b) Anticipatory fetch

c) First-fit placement

d) Next-fit placement

Section 9.6

9.9 In general, the overhead incurred by ________ allocation is outweighed by the advantages of being able to store

more processes in main memory at the same time.

a) contiguous

b) noncontiguous

c) fragment

d) segment

9.10 Noncontiguous memory allocation splits programs into blocks of memory called ________ that can be loaded

into nonadjacent “holes” in main memory.

a) pages

b) partitions

c) frames

d) segments

Section 9.7

9.11 Before the advent of ________, programmers wrote all the code necessary to implement a particular application,

including the highly detailed machine-level input/output instructions.

a) an IOCS

b) a BIOS

c) object-oriented programming languages

d) memory management

Section 9.7.1

9.12 ________ is a technique that involves breaking a program into logical segments and keeping only the currently

needed segment in memory at any one time.

a) Caching

b) Swapping

c) Dynamic programming

d) Creating overlays

Page 17: Review Questions Second Test

9.13 ________ can be thought of as a modern operating system-controlled version of overlays.

a) IOCS

b) Virtual memory

c) Caching

d) Noncontiguous memory

Section 9.7.2

9.14 A(n) ________ can be used in single-user contiguous memory allocation systems to prevent programs from

damaging the operating system’s memory.

a) lock

b) protection bit

c) boundary register

d) semaphore

9.15 To allow programs to access and execute operating system instructions, operating systems provide ________.

a) the executive mode of execution

b) system calls

c) memory protection keys

d) both a and b

Section 9.7.3

9.16 ________ was an early innovation that helped decrease the amount time the computer wasted between jobs.

a) Batch processing

b) Interactive computing

c) Single-user contiguous memory allocation

d) both a and b

9.17 A ________ reads and executes the control-language statements that define each job as well as helps prepare the

system for the next job.

a) boundary register

b) batch processor

c) single-stream batch processor

d) job stream processor

Section 9.8

9.18 Under fixed-partition multiprogramming, ________ occurs when a memory partition is larger than the memory

and data of the process currently loaded into it.

a) compaction

b) garbage collection

c) internal fragmentation

d) external fragmentation

9.19 In a partitioned memory environment, the single boundary register is replaced by the ________ and ________

registers which delimit the upper and lower boundaries of a partition, respectively.

a) base, limit

b) limit, base

c) high, low

d) low, high

Section 9.9

9.20 ________-partition multiprogramming allows a process to occupy only as much space as needed in an attempt to

prevent ________ fragmentation.

Page 18: Review Questions Second Test

a) Variable, internal

b) Fixed, internal

c) Variable, external

d) Fixed, external

Section 9.9.1

9.21 To maximize the use of available space, ________ combines adjacent holes in memory, while ________

relocates all occupied areas of memory to one end of main memory, leaving a single large free memory hole instead of

numerous small holes.

a) internal fragmentation, external fragmentation

b) compaction, coalescing

c) coalescing, compaction

d) variable-partition multiprogramming, fixed-partition multiprogramming

9.22 The significant overhead associated with ________ makes it largely unsuitable for use in real-time systems.

a) coalescing

b) compaction

c) memory protection

d) fixed-partition multiprogramming

Section 9.9.2

9.23 Under a ________ placement strategy, the system places an incoming job in the hole in main memory in which it

fits most tightly.

a) first-fit

b) next-fit

c) best-fit

d) worst-fit

9.24 The ________ placement strategy allows the system to make a placement decision quickly and generally incurs

the least amount of overhead of the various placement strategies.

a) best-fit

b) worst-fit

c) first-fit

d) none of the above

Section 9.10

9.25 ________ temporarily removes a process from main memory to allow another process to make use of the

system’s resources.

a) Swapping

b) Switching

c) Compacting

d) Coalescing

Page 19: Review Questions Second Test

Chapter 10

Section 10.1

No questions.

Section 10.2

10.1 In a virtual memory system , ________.

a) each virtual address space is much smaller than the real address space

b) determining how to map virtual addresses to physical addresses is of great importance

c) MMUs convert physical addresses to virtual addresses during execution

d) when the system is ready to run a process, the system loads the process’s code and data from main memory into

cache

10.2 Systems that use dynamic address translation exhibit ________—the property that contiguous addresses in a

process’s virtual address space need not be contiguous in physical memory.

a) transparent contiguity

b) dynamic contiguity

c) artificial contiguity

d) static contiguity

Section 10.3

10.3 In block mapping systems, _________.

a) the larger the average block size, the larger the amount of mapping information

b) larger blocks can lead to internal fragmentation and can take longer to transfer between secondary storage and main

memory

c) fixed-size blocks are called segments

d) variable-size blocks are called pages

10.4 In a block mapping system, suppose that a is a base address stored in the block map table origin register and that

the block map table for the process with base address a contains the real address b’ for the start of virtual block b in

main memory and the real address d’ for the start of virtual block d in main memory. What is the real address of virtual

address v = (b, d)?

a) b’ + d

b) d’ + b

c) a + b’

d) a + d’

Section 10.4

10.5 In a paging system, ________.

a) a page frame is always larger than an incoming page

b) a page frame is always smaller than the incoming page

c) given the virtual memory address v = (p, d), where page p is in page frame p’ and the fixed page size is ps, then the

real memory address of v is (p’ + d) * ps

d) when a process references a page that is not in main memory, the operating system loads the nonresident page into

memory from secondary storage

Page 20: Review Questions Second Test

10.6 When a page references a page that is not in main memory, the processor generates a(n) ________.

a) TLB miss

b) page fault

c) general protection fault

d) missing-segment fault

Section 10.4.1

10.7 Consider paging address translation by direct mapping. Given the base address, a, in the page table origin

register, virtual address v = (p, d) and an entry p’ (in the page table starting at address a) for the page frame

corresponding to virtual page p, what is the real address corresponding to v?

a) p’ * d

b) p’ concatenated with d

c) (a + p) * d

d) (a + p) concatenated with d

10.8 Which of the following statements about direct mapping is false?

a) Direct mapping is much like accessing an array location via subscripting.

b) The direct-mapped page table typically is kept in main memory.

c) Using direct-mapping page address translation can cause the computer system to run programs faster.

d) If a process contains n pages in virtual memory space, then the direct-mapped page table for the process contains

entries successively for page 0, page 1, page 2, …, page n-1.

Section 10.4.2

10.9 An associative mapping __________.

a) stores the entire page table in content-addressed associative memory

b) provides better performance than direct mapping

c) is too expensive to implement

d) all of the above

Section 10.4.3

10.10 A combined direct/associative mapping holds only a small percentage of the complete page table for a process in

__________ and keeps the complete page table in __________.

a) secondary storage, direct-mapped memory

b) direct-mapped memory, secondary storage

c) associative memory, main memory

d) associative memory, secondary storage

10.11 Under direct/associative mapping, ________.

a) accessing the associative memory is slower than accessing the main memory

b) the number of entries in the TLB needs to be large to achieve good performance

c) the page table entries maintained in the TLB typically correspond only to the more-recently referenced pages

d) better performance can be achieved than under a complete associative mapping

Page 21: Review Questions Second Test

Section 10.4.4

10.12 In multilevel page tables, __________ is reduced compared to direct-mapped tables when process’s use only a

small number of pages.

a) internal fragmentation

b) external fragmentation

c) memory fragmentation

d) table fragmentation

10.13 The overhead incurred by multilevel page address translation is __________.

a) significant due to increased table fragmentation

b) significant due to additional memory references

c) offset by caches and TLBs

d) none of the above

Section 10.4.5

10.14 In an inverted page table, the number of PTEs that must be stored in main memory is proportional to _________.

a) the size of physical memory

b) the size of virtual memory

c) the size of a virtual address space

d) the size of the process

10.15 Inverted page tables use __________ to map virtual pages to PTEs.

a) arrays

b) hash functions

c) linked lists

d) chaining mechanisms

10.16 To improve performance, a designer can attempt to reduce the number of collisions that occur in an inverted

page table by ________.

a) increasing the size of the inverted page table

b) increasing the range of the hash function using a hash anchor table

c) both a and b

d) none of the above

Section 10.4.6

10.17 Page sharing ________.

a) increases the amount of main memory required for a group of processes to run efficiently

b) decreases a system’s degree of multiprogramming

c) does not allow modifiable procedures from being used by more than one process at the same time

d) none of the above

Page 22: Review Questions Second Test

10.18 Using copy-on-write to ensure that two processes do not interfere with each other when modifying pages

________.

a) slows down process creation

b) improves performance when processes modify a significant amount of shared data during execution

c) both a and b

d) none of the above

Section 10.5

10.19 All of a process’s segments ________.

a) must consist of contiguous memory locations

b) must be the same size

c) must be placed adjacent to one another in main memory

d) are maintained in main memory during execution

Section 10.5.1

10.20 In a system that uses segmentation address translation by direct mapping, ________.

a) the segment map table origin register contains the segment map table’s base address value

b) the mapping mechanism uses the information stored in the segment map table to translate the virtual address to a

physical address

c) the sum of the segment map table’s base address and the segment number determines the location of the segment’s

map table entry

d) all of the above

10.21 A(n) __________ is generated when a displacement is greater than a segment length.

a) missing-segment fault

b) general protection fault

c) segment-overflow exception

d) segment-protection exception

Section 10.5.2

10.22 Sharing __________ using segmentation can simplify memory management compared to paging.

a) an object

b) reentrant code

c) a dynamic array

d) all of the above

Section 10.5.3

10.23 ________ access is useful for reentrant code because it allows a process to execute a segment or make its own

copy of a segment which it may then modify.

a) Read/write

b) Read/execute

c) Write/execute

d) Execute only

Page 23: Review Questions Second Test

10.24 A process given append-only access to a segment may __________.

a) read information from the segment

b) write information to the segment

c) pass program control to instructions in that segment for execution on a processor

d) write additional information to the end of the segment, but not modify existing information

Section 10.6

10.25 In a combined segmentation/paging system, ________.

a) all the pages of a segment must be in main memory at once

b) virtual memory pages that are contiguous in virtual memory must be contiguous in main memory

c) segments typically are arranged across multiple pages

d) all of the above

Section 10.6.1

10.26 In a paged and segmented system using combined associative/direct mapping, ________.

a) missing-segment faults, segment-overflow exceptions and segment-protection exceptions can never occur during

dynamic address translation

b) the more tables a system maintains in main memory, the fewer processes it can support

c) the associative memory is unimportant to the efficient operation of the dynamic address translation

d) the benefit of maintaining only a few of the tables in main memory at any one time is that address translation

proceeds faster at execution time

Section 10.6.2

10.27 In a segmentation/paging virtual memory system, two processes share memory when ________.

a) each process has a segment map table entry that points to the same page table

b) each process uses the same segment map table

c) each process shares a page table

d) both a and c

Section 10.7

10.28 In the IA-32 architecture, the ________ register typically stores a process’s code segment selector (which

typically corresponds to the segment containing its executable instructions).

a) SS

b) FS

c) ES

d) CS

10.29 For operating systems that maintain more than 8,192 segments, or that maintain a separate segment map table

for each process, the IA-32 architecture requires the base address of each local descriptor table to be stored in the

__________.

a) global descriptor table

b) global descriptor table register

c) local descriptor table register

d) none of the above

Page 24: Review Questions Second Test

10.30 In the IA-32 architecture, a(n) ________ occurs when a process has attempted to access memory outside of its

segment.

a) page fault

b) general protection fault exception

c) segment-overflow exception

d) TLB miss

Page 25: Review Questions Second Test