Test Bank Docx Ch4 Threads & Concurrency - Operating System Concepts 10e Complete Test Bank by Abraham Silberschatz. DOCX document preview.
Chapter 4
Multiple Choice
1. 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
Feedback: 4.1
Difficulty: Easy
2. 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
Feedback: 4.1.1
Difficulty: Medium
3. Which of the following benefits go to multithreaded programming?
A) responsiveness
B) resource sharing
C) economy
D) scalability
E) all of the above
Feedback: 4.1.2
Difficulty: Easy
4. 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
Feedback: 4.2
Difficulty: Medium
5. ___________ 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
Feedback: 4.2.1
Difficulty: Medium
6. _____ 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.
Feedback: 4.2.1
Difficulty: Medium
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
Feedback: 4.3
Difficulty: Easy
8. ____ 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
Feedback: 4.3.1
Difficulty: Medium
9. 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
Feedback: 4.3.2
Difficulty: Easy
10. 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
Feedback: 4.3.3
Difficulty: Easy
11. 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
Feedback: 4.4.1
Difficulty: Easy
12. 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()
Section 4.4.2
Difficulty: Medium
13. 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.
Feedback: 4.4.3
Difficulty: Medium
14. 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
Feedback: 4.4.3
Difficulty: Easy
15. Which of the following is a method for implicit threading?
A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Feedback: 4.5
Difficulty: Easy
16. Which of the following implicit threading methodology involves dispatch queues?
A) thread pools
B) OpenMP
C) grand central dispatch
D) all of the above
Feedback: 4.5.4
Difficulty: Easy
17. 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
Feedback: 4.6.2
Difficulty: Medium
18. 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
Feedback: 4.6.2
Difficulty: Medium
19. 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
Feedback: 4.6.2
Difficulty: Easy
20. Which of the following options to deliver signals in multithreaded program should be applied to an asynchronous signal that terminates a process (<control><C>, 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
Feedback: 4.6.2
Difficulty: Medium
21. 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
Feedback: 4.6.2
Difficulty: Medium
22. Signals can be emulated in windows through ____.
A) asynchronous procedure calls
B) local procedure calls
C) remote procedure calls
D) none of the above
Feedback: 4.6.2
Difficulty: Medium
23. Which of the following cancellation modes are supported by Pthreads?
A) off mode
B) deferred mode
C) asynchronous mode
D) all of the above
Feedback: 4.6.3
Difficulty: Easy
24. 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
Feedback: 4.6.3
Difficulty: Easy
25. 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
Feedback: 4.6.3
Difficulty: Medium
26. 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
Feedback: 4.6.4
Difficulty: Easy
27. 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
Feedback: 4.6.5
Difficulty: Easy
28. 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
Feedback: 4.6.5
Difficulty: Medium
29. Which are included in the context of a thread?
A) register set
B) stacks
C) private storage area
D) all of the above
Feedback: 4.7.1
Difficulty: Easy
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
Feedback: 4.7.2
Difficulty: Easy
Essay Questions
1. Why should a web server not run as a single-threaded process?
Feedback: 4.1.1
Difficulty: Medium
2. List the four major categories of the benefits of multithreaded programming. Briefly explain each.
Feedback: 4.1.2
Difficulty: Hard
3. Distinguish between parallelism and concurrency.
Feedback: 4.2
Difficulty: Medium
4. Multicore systems present certain challenges for multithreaded programming. Briefly describe these challenges.
Feedback: 4.2.1
Difficulty: Difficult
5. Distinguish between data and task parallelism.
And: Data parallelism involves distributing subsets of the same data across multiple computing cores and performing the same operation on each core. Task parallelism involves distributing tasks across the different computing cores where each task is performing a unique operation.
Feedback: 4.2.2
Difficulty: Hard
6. What are the two different ways in which a thread library could be implemented?
Feedback: 4.4
Difficulty: Medium
7. What are the general components of a thread in Windows?
Feedback: 4.4.2
Difficulty: Medium
8. Describe two techniques for creating Thread objects in Java.
Feedback: 4.4.3
Difficulty: Medium
9. In Java, what two things does calling the start() method for a new Thread object accomplish?
Feedback: 4.4.3
Difficulty: Medium
10. What is a thread pool and why is it used?
Feedback: 4.5.1
Difficulty: Medium
11. Describe how OpenMP is a form of implicit threading.
Feedback: 4.5.2
Difficulty: Hard
12. Describe how Grand Central Dispatch is a form of implicit threading.
Feedback: 4.5.3
Difficulty: Hard
13. Some UNIX systems have two versions of fork(). Describe the function of each version, as well as how to decide which version to use.
Feedback: 4.6.1
Difficulty: Hard
14. How can deferred cancellation ensure that thread termination occurs in an orderly manner as compared to asynchronous cancellation?
Feedback: 4.6.3
Difficulty: Medium
15. Describe the difference between the fork() and clone() Linux system calls.
Feedback: 4.7.2
Difficulty: Medium
True/False Questions
1. Virtually all contemporary operating systems support kernel threads.
Feedback: 4.1.1
Difficulty: Easy
2. Amdahl's Law describes performance gains for applications with both a serial and parallel component.
Feedback: 4.2
Difficulty: Medium
3. Concurrency is inherently equivalent to parallelism.
Feedback: 4.2
Difficulty: Medium
4. Parallelism can be achieved on single-processor systems.
Feedback: 4.2
Difficulty: Medium
5. Task parallelism distributes threads and data across multiple computing cores.
Feedback: 4.2.2
Difficulty: Difficult
6. 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.
Feedback: 4.3.2
Difficulty: Easy
7. In Java, data shared between threads is simply declared globally.
Feedback: 4.4.3
Difficulty: Medium
8. The trend in developing parallel applications is to use implicit threading.
Feedback: 4.5
Difficulty: Medium
9. The single benefit of a thread pool is to control the number of threads.
Feedback: 4.5.1
Difficulty: Easy
10. OpenMP only works for C, C++, and Fortran programs.
Feedback 4.5.2:
Difficulty: Medium
11. Grand Central Dispatch requires multiple threads.
Feedback: 4.5.3
Difficulty: Medium
12. The default signal handler can be overridden by a user-defined signal handler.
Feedback: 4.6.2
Difficulty: Easy
13. Deferred cancellation is preferred over asynchronous cancellation.
Feedback: 4.6.3
Difficulty: Easy
14. Thread-local storage is inherently equivalent to local variables.
Feedback: 4.6.4
Difficulty: Medium
15. 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.
Feedback: 4.7.2
Difficulty: Medium
Document Information
Connected Book
Operating System Concepts 10e Complete Test Bank
By Abraham Silberschatz