Deck 4: Threads Concurrency

Full screen (f)
exit full mode
Question
Which of the following is a synchronous signal?

A) illegal memory access
B) terminating a process with specific keystrokes
C) having a timer expire
D) none of the above
Use Space or
up arrow
down arrow
to flip the card.
Question
Which of the following benefits go to multithreaded programming?

A) responsiveness
B) resource sharing
C) economy
D) scalability
E) all of the above
Question
Which of the following items are shared across multiple threads belonging to the same process?

A) code, data, files
B) registers
C) stack
D) all of the above
Question
In a multithreaded server architecture, which of the following is used to service a new user request?

A) a new created thread
B) a new created process
C) the same process for prior users
D) none of the above
Question
Which of the following is a method for implicit threading?

A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Question
Which of the following refers to the capability to allow multiple tasks make progress on a single processor system?

A) concurrency
B) parallelism
C) data parallelism
D) task parallelism
Question
Which of the following models are possible for the relationship between the user threads and kernel threads?

A) many-to-one model
B) one-to-one model
C) many-to-many model
D) two-level model
E) all of the above
Question
Which of the following statements regarding threads is false?

A) Sharing is automatically provided in Java threads.
B) Both Pthreads and Win32 threads share global data.
C) The start() method actually creates a thread in the Java virtual machine.
D) The Java method join() provides similar functionality as the WaitForSingleObject in Win32.
Question
The most common technique for writing multithreaded Java programs is _____.

A) extending the Thread class and overriding the run() method
B) implementing the Runnable interface and defining its run() method
C) designing your own Thread class
D) using the CreateThread() function
Question
___________ is a formula that identifies potential performance gains from adding additional computing cores to an application that has a parallel and serial component.

A) Task parallelism
B) Data parallelism
C) Data splitting
D) Amdahl's Law
Question
Which of the following options to deliver signals in multithreaded program should be applied to an asynchronous signal that terminates a process (, for example)?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Question
Which of the following options exist to deliver signals in multithreaded program?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Question
The _____ model multiplexes many user-level threads to a smaller or equal number of kernel threads.

A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
Question
The _____ model maps each user-level thread to one kernel thread.

A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
Question
_____ is not considered a challenge when designing applications for multicore systems.

A) Deciding which activities can be run in parallel
B) Ensuring there is a sufficient number of cores
C) Determining if data can be separated so that it is accessed on separate cores
D) Identifying data dependencies between tasks.
Question
____ is a thread library for Solaris that maps many user-level threads to one kernel thread.

A) Pthreads
B) Green threads
C) Sthreads
D) Java threads
Question
In Pthreads, a parent uses the pthread_join() function to wait for its child thread to complete. What is the equivalent function in Win32?

A) win32_join()
B) wait()
C) WaitForSingleObject()
D) join()
Question
Which of the following is a function that can be provided by Pthreads API for constructing a multithreaded program?

A) pthread attr init
B) pthread_create
C) pthread_join
D) all of the above
Question
Which of the following is an asynchronous signal?

A) illegal memory access
B) division by zero
C) terminating a process with specific keystrokes
D) none of the above
Question
Which of the following implicit threading methodology involves dispatch queues?

A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Question
Describe two techniques for creating Thread objects in Java.
Question
List the four major categories of the benefits of multithreaded programming. Briefly explain each.
Question
Distinguish between parallelism and concurrency.
Question
In Java, what two things does calling the start() method for a new Thread object accomplish?
Question
To associate each thread created using an implicit technique such as a thread pool, with its unique transaction identifier, we could use ____?

A) global variable
B) local variable
C) static data
D) thread-local storage
Question
Multicore systems present certain challenges for multithreaded programming. Briefly describe these challenges.
Question
Describe how OpenMP is a form of implicit threading.
Question
Which of the following cancellation modes are supported by Pthreads?

A) off mode
B) deferred mode
C) asynchronous mode
D) all of the above
Question
What is a thread pool and why is it used?
Question
Which of the following information is shared when the flag CLONE_VM is set up?

A) file-system information
B) memory space
C) signal handlers
D) set of open files
Question
What are the two different ways in which a thread library could be implemented?
Question
Which of the following options to deliver signals in multithreaded program should be applied to a synchronous signal?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Question
Which of the following Pthread function is used to respond to a cancellation request using deferred cancellation?

A) pthread attr init
B) pthread_create
C) pthread_join
D) pthread_testcancel
Question
LWP is ____.

A) short for lightweight processor
B) placed between system and kernel threads
C) placed between user and kernel threads
D) common in systems implementing one-to-one multithreading models
Question
Which are included in the context of a thread?

A) register set
B) stacks
C) private storage area
D) all of the above
Question
What are the general components of a thread in Windows?
Question
In multithreaded programs, the kernel informs an application about certain events using a procedure known as a(n) ____.

A) signal
B) upcall
C) event handler
D) pool
Question
Why should a web server not run as a single-threaded process?
Question
Signals can be emulated in windows through ____.

A) asynchronous procedure calls
B) local procedure calls
C) remote procedure calls
D) none of the above
Question
Which of the following cancellation modes is the default cancellation type?

A) off mode
B) deferred mode
C) asynchronous mode
D) all of the above
Question
Parallelism can be achieved on single-processor systems.
Question
Grand Central Dispatch requires multiple threads.
Question
In Java, data shared between threads is simply declared globally.
Question
Deferred cancellation is preferred over asynchronous cancellation.
Question
How can deferred cancellation ensure that thread termination occurs in an orderly manner as compared to asynchronous cancellation?
Question
Amdahl's Law describes performance gains for applications with both a serial and parallel component.
Question
OpenMP only works for C, C++, and Fortran programs.
Question
Virtually all contemporary operating systems support kernel threads.
Question
Describe how Grand Central Dispatch is a form of implicit threading.
Question
One-to-one model provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call.
Question
Describe the difference between the fork() and clone() Linux system calls.
Question
The single benefit of a thread pool is to control the number of threads.
Question
Concurrency is inherently equivalent to parallelism.
Question
Task parallelism distributes threads and data across multiple computing cores.
Question
Some UNIX systems have two versions of fork(). Describe the function of each version, as well as how to decide which version to use.
Question
Thread-local storage is inherently equivalent to local variables.
Question
When fork() is invoked, it is passed a set of flags that determine how much sharing is to take place between the parent and child tasks.
Question
The trend in developing parallel applications is to use implicit threading.
Question
The default signal handler can be overridden by a user-defined signal handler.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/59
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 4: Threads Concurrency
1
Which of the following is a synchronous signal?

A) illegal memory access
B) terminating a process with specific keystrokes
C) having a timer expire
D) none of the above
A
2
Which of the following benefits go to multithreaded programming?

A) responsiveness
B) resource sharing
C) economy
D) scalability
E) all of the above
E
3
Which of the following items are shared across multiple threads belonging to the same process?

A) code, data, files
B) registers
C) stack
D) all of the above
A
4
In a multithreaded server architecture, which of the following is used to service a new user request?

A) a new created thread
B) a new created process
C) the same process for prior users
D) none of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
5
Which of the following is a method for implicit threading?

A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
6
Which of the following refers to the capability to allow multiple tasks make progress on a single processor system?

A) concurrency
B) parallelism
C) data parallelism
D) task parallelism
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
7
Which of the following models are possible for the relationship between the user threads and kernel threads?

A) many-to-one model
B) one-to-one model
C) many-to-many model
D) two-level model
E) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
8
Which of the following statements regarding threads is false?

A) Sharing is automatically provided in Java threads.
B) Both Pthreads and Win32 threads share global data.
C) The start() method actually creates a thread in the Java virtual machine.
D) The Java method join() provides similar functionality as the WaitForSingleObject in Win32.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
9
The most common technique for writing multithreaded Java programs is _____.

A) extending the Thread class and overriding the run() method
B) implementing the Runnable interface and defining its run() method
C) designing your own Thread class
D) using the CreateThread() function
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
10
___________ is a formula that identifies potential performance gains from adding additional computing cores to an application that has a parallel and serial component.

A) Task parallelism
B) Data parallelism
C) Data splitting
D) Amdahl's Law
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
11
Which of the following options to deliver signals in multithreaded program should be applied to an asynchronous signal that terminates a process (, for example)?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
12
Which of the following options exist to deliver signals in multithreaded program?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
13
The _____ model multiplexes many user-level threads to a smaller or equal number of kernel threads.

A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
14
The _____ model maps each user-level thread to one kernel thread.

A) many-to-many
B) two-level
C) one-to-one
D) many-to-one
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
15
_____ is not considered a challenge when designing applications for multicore systems.

A) Deciding which activities can be run in parallel
B) Ensuring there is a sufficient number of cores
C) Determining if data can be separated so that it is accessed on separate cores
D) Identifying data dependencies between tasks.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
16
____ is a thread library for Solaris that maps many user-level threads to one kernel thread.

A) Pthreads
B) Green threads
C) Sthreads
D) Java threads
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
17
In Pthreads, a parent uses the pthread_join() function to wait for its child thread to complete. What is the equivalent function in Win32?

A) win32_join()
B) wait()
C) WaitForSingleObject()
D) join()
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
18
Which of the following is a function that can be provided by Pthreads API for constructing a multithreaded program?

A) pthread attr init
B) pthread_create
C) pthread_join
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
19
Which of the following is an asynchronous signal?

A) illegal memory access
B) division by zero
C) terminating a process with specific keystrokes
D) none of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
20
Which of the following implicit threading methodology involves dispatch queues?

A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
21
Describe two techniques for creating Thread objects in Java.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
22
List the four major categories of the benefits of multithreaded programming. Briefly explain each.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
23
Distinguish between parallelism and concurrency.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
24
In Java, what two things does calling the start() method for a new Thread object accomplish?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
25
To associate each thread created using an implicit technique such as a thread pool, with its unique transaction identifier, we could use ____?

A) global variable
B) local variable
C) static data
D) thread-local storage
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
26
Multicore systems present certain challenges for multithreaded programming. Briefly describe these challenges.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
27
Describe how OpenMP is a form of implicit threading.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
28
Which of the following cancellation modes are supported by Pthreads?

A) off mode
B) deferred mode
C) asynchronous mode
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
29
What is a thread pool and why is it used?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
30
Which of the following information is shared when the flag CLONE_VM is set up?

A) file-system information
B) memory space
C) signal handlers
D) set of open files
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
31
What are the two different ways in which a thread library could be implemented?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
32
Which of the following options to deliver signals in multithreaded program should be applied to a synchronous signal?

A) deliver the signal to the thread to which the signal applies
B) deliver the signal to every thread in the process
C) deliver the signal to certain threads in the process
D) assign a specific thread to receive all signals for the process
E) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
33
Which of the following Pthread function is used to respond to a cancellation request using deferred cancellation?

A) pthread attr init
B) pthread_create
C) pthread_join
D) pthread_testcancel
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
34
LWP is ____.

A) short for lightweight processor
B) placed between system and kernel threads
C) placed between user and kernel threads
D) common in systems implementing one-to-one multithreading models
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
35
Which are included in the context of a thread?

A) register set
B) stacks
C) private storage area
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
36
What are the general components of a thread in Windows?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
37
In multithreaded programs, the kernel informs an application about certain events using a procedure known as a(n) ____.

A) signal
B) upcall
C) event handler
D) pool
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
38
Why should a web server not run as a single-threaded process?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
39
Signals can be emulated in windows through ____.

A) asynchronous procedure calls
B) local procedure calls
C) remote procedure calls
D) none of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
40
Which of the following cancellation modes is the default cancellation type?

A) off mode
B) deferred mode
C) asynchronous mode
D) all of the above
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
41
Parallelism can be achieved on single-processor systems.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
42
Grand Central Dispatch requires multiple threads.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
43
In Java, data shared between threads is simply declared globally.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
44
Deferred cancellation is preferred over asynchronous cancellation.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
45
How can deferred cancellation ensure that thread termination occurs in an orderly manner as compared to asynchronous cancellation?
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
46
Amdahl's Law describes performance gains for applications with both a serial and parallel component.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
47
OpenMP only works for C, C++, and Fortran programs.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
48
Virtually all contemporary operating systems support kernel threads.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
49
Describe how Grand Central Dispatch is a form of implicit threading.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
50
One-to-one model provides more concurrency than the many-to-one model by allowing another thread to run when a thread makes a blocking system call.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
51
Describe the difference between the fork() and clone() Linux system calls.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
52
The single benefit of a thread pool is to control the number of threads.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
53
Concurrency is inherently equivalent to parallelism.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
54
Task parallelism distributes threads and data across multiple computing cores.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
55
Some UNIX systems have two versions of fork(). Describe the function of each version, as well as how to decide which version to use.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
56
Thread-local storage is inherently equivalent to local variables.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
57
When fork() is invoked, it is passed a set of flags that determine how much sharing is to take place between the parent and child tasks.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
58
The trend in developing parallel applications is to use implicit threading.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
59
The default signal handler can be overridden by a user-defined signal handler.
Unlock Deck
Unlock for access to all 59 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 59 flashcards in this deck.