Quiz 5 - Threads
_____ is not considered a challenge when designing applications for multicore systems. Deciding which activities can be run in parallel Ensuring there is a sufficient number of cores Determining if data can be separated so that it is accessed on separate cores Identifying data dependencies between tasks
Ensuring there is a sufficient number of cores
A traditional (or heavyweight) process has a single thread of control. True False
True
Each thread has its own register set and stack. True False
True
It is possible to create a thread library without any kernel-level support. True False
True
Virtually all contemporary operating systems support kernel threads. True False
True
The most common technique for writing multithreaded Java programs is _____. extending the Thread class and overriding the run() method implementing the Runnable interface and defining its run() method designing your own Thread class using the CreateThread() function
implementing the Runnable interface and defining its run() method
A ____ provides an API for creating and managing threads. set of system calls multicore system thread library multithreading model
thread library
A _____ uses an existing thread — rather than creating a new one — to complete a task. lightweight process thread pool scheduler activation asynchronous procedure call
thread pool
The _____ model allows a user-level thread to be bound to one kernel thread. many-to-many two-level one-to-one many-to-one
two-level
___________ is a formula that identifies potential performance gains from adding additional computing cores to an application that has a parallel and serial component. Task parallelism Data parallelism Data splitting Amdahl's Law
Amdahl's Law
Grand Central Dispatch requires multiple threads. True False
False
Linux distinguishes between processes and threads. True False
False
Task parallelism distributes threads and data across multiple computing cores. True False
False
The single benefit of a thread pool is to control the number of threads. True False
False
Which of the following statements regarding threads is false? Sharing is automatically provided in Java threads.Both Pthreads and Win32 threads share global data.The start() method actually creates a thread in the Java virtual machine.The Java method join() provides similar functionality as the WaitForSingleObject in Win32.
Sharing is automatically provided in Java threads.
In Pthreads, a parent uses the pthread_join() function to wait for its child thread to complete. What is the equivalent function in Win32? win32_join() wait() WaitForSingleObject() join()
WaitForSingleObject()
Grand Central Dispatch handles blocks by ____. placing them on a dispatch queue creating a new thread placing them on a dispatch stack constructing a parallel region
placing them on a dispatch queue
Signals can be emulated in windows through ____. asynchronous procedure calls local procedure calls remote procedure calls none of the above
asynchronous procedure calls
Cancellation points are associated with ____ cancellation. asynchronous deferred synchronous non-deferred
deferred
Thread-local storage is data that ____. is not associated with any process has been modified by the thread, but not yet updated to the parent process is generated by the thread independent of the thread's process is unique to each thread
is unique to each thread
The ____ multithreading model multiplexes map many user-level threads to a smaller or equal number of kernel threads. many-to-one one-to-one many-to-many many-to-some
many-to-many
The _____ model multiplexes map many user-level threads to a smaller or equal number of kernel threads. many-to-many two-level one-to-one many-to-one
many-to-many
The _____ model maps many user-level threads to one kernel thread. many-to-many two-level one-to-one many-to-one
many-to-one
The _____ model maps each user-level thread to one kernel thread. many-to-many two-level one-to-one many-to-one
one-to-one
LWP is ____. short for lightweight processor placed between system and kernel threads placed between user and kernel threads common in systems implementing one-to-one multithreading models
placed between user and kernel threads
