Chapter 4 Flashcards
Limiting the number of threads helps avoid exhausting system resources is a benefit of ………….
Thread pool
In one-to-one model, Multiple threads can run in parallel on multi-core systems (T/F)
True
A thread comprises a thread ID, a PC, a …………, and a stack
register set
In …………, Each task is mapped to a separate thread using the many-to-many model
implicit threading
Process threads share code section, ……….. , and resources
data section
Most operating systems use the ………….. model
one-to-one
……………: Thread creation has less overhead than process creation
(Benefits of Multithreaded Programs)
Economy
Process threads share ………, data section, and resources
code section
Cancellation of a target thread can be asynchronous or deferred
(T/F)
True
In Many-to-Many model, Multiple threads can run in parallel on multi-core systems
(T/F)
True
Does not suffer from the drawback of the many-to-one model is an advantage of Many-to-Many Model
(T/F)
True
Implicit fork-join is a synchronous version of the ……….
Thread pool
In Many-to-one model, The entire process will block if a thread makes a blocking system call (T/F)
True
……………: Threads can run in parallel on a multiprocessor machine
(Benefits of Multithreaded Programs)
Scalability
Distribution of data across multiple cores
Data parallelism
………………: Ensure that these tasks perform equal work of equal value
(Multi-core Programming
Challenges)
Balance
In …………, When the server receives a request, it submits it to the pool
Thread pool
In one-to-one model, When a thread makes a blocking system call, another thread cannot run (T/F)
False
In …………, A library manages the creation of threads and assigns tasks to those threads
Implicit fork-join
In one-to-one model, multiple threads can access the kernel at a given time
(T/F)
True
………… is a synchronous version of the thread pool
Implicit fork-join
In Many-to-Many model, only one thread can access the kernel at a given time
(T/F)
False
In ………….., If the pool has a thread, the request is served immediately
Thread pool
In ………….., Once a thread completes serving the request, it returns to the pool
Thread pool
In asynchronous cancellation, One thread immediately terminates the target thread
(T/F)
True
A traditional process has a …….. thread of control
single
………….. Helps developing modern applications with hundreds of threads
implicit threading
………….. are managed without OS support
user threads
Developers identify tasks and the library maps them to ……….. threads
(User / kernel)
Kernel
In Many-to-one model, Threads can run in parallel on multi-core systems (T/F)
False
A ………….. can adjust the number of threads in the pool
dynamic thread pool
In ……………., If the pool is empty, the task is queued until a thread becomes free
Thread pool
In …………., checking whether the target should terminate allows the target thread to terminate itself in an orderly fashion
Deferred cancellation
In ………….., Threads are not constructed but parallel tasks are designated
Implicit fork-join
A ………… process can perform one task at a time
single-threaded
In two-level model, No need to limit the number of kernel threads on modern multicore systems
(T/F)
True
…………..: A blocked thread doesn’t block the process
(Benefits of Multithreaded Programs)
Responsiveness
It is very easy to implement the many-to-many model
(T/F)
False
In ……………, Run-time libraries (not programmers) create and manage threads
implicit threading
In ………………, Programmers identify tasks (not threads) that can run in parallel
implicit threading
In …………., The target thread periodically checks whether it should terminate
Deferred cancellation
…………… works well for asynchronous (independent) tasks
Thread pool
……………..: Threads share the resources of the process
(Benefits of Multithreaded Programs)
Resource sharing
A ….. comprises a thread ID, a PC, a register set, and a stack
thread
……………. works well for tasks that are synchronous (cooperating)
Fork-join
In traditional ……………, the main parent thread create one or more child threads
Fork-Join
In …………….., The number of threads that can be created has no upper bound
explicit threading
In Many-to-Many Model, Increasing the number of user threads does not affect system performance (T/F)
True
Distribution of tasks across multiple cores
Task parallelism
In ……… threading, the server creates a thread for each request
Explicit
In Many-to-one model, Thread management is done in OS space by a thread library not user
(T/F)
False
………..: Testing a program with many execution paths
(Multi-core Programming Challenges)
Testing and debugging
In traditional ……………, the main parent thread wait for the created threads (children) to terminate
Fork-Join
In ………………., The programmer writes a task as a function
implicit threading
……………: Divide data between tasks that run on separate cores
(Multi-core Programming
Challenges)
Data splitting
……………: Examine data to find dependencies between tasks
(Multi-core Programming
Challenges)
Data dependency
A ………. is a single sequence of execution
Thread
In ……….., Each new request requires creating a new thread
explicit threading
In Many-to-one model, Only …….. user thread can access the kernel at a time
one
In Many-to-Many model, OS creates a set of kernel threads (less than or equal to user threads)
(T/F)
True
In one-to-one model, OS creates a kernel thread per user thread (can burden performance)
(T/F)
True
In ……………….., The thread is discarded once it has completed its work
explicit threading
A …….. is the basic unit of CPU
thread
In …………………, Too many threads that work concurrently can exhaust system resources
explicit threading
…………. are supported and managed directly by the OS
Kernel threads
In Many-to-Many model, When a thread makes a blocking system call, another thread can run
(T/F)
True
………….: divide program into tasks that can run in parallel
(Multi-core Programming
Challenges)
Identifying tasks
Serving a request with an existing thread is faster than creating a thread is a benefit of …………..
Thread pool
Does not suffer from the drawback of the one-to-one model is a disadvantage of Many-to-Many Model
(T/F)
False
A thread comprises a thread ID, a PC, a register set, and a ………
stack
Refers to terminating a thread before it has completed
Thread Cancellation
In …………., One thread immediately terminates the target thread
Asynchronous cancellation
In traditional ……………, the main parent thread join the threads, at which point it can retrieve and combine their results
Fork-Join
Modern concurrency libraries use the ………….. model
many-to-many
A …….. process can perform multiple tasks at a time
multi-threaded