ch4 review silberschatz operating systems concepts essentials 2nd ed
Review Questions
Section 4.1
4.1 How many threads does a traditional, heavyweight process have? a single thread of control
4.2 Provide at least three benefits of multithreaded programming. responsiveness resource sharing economy and scalability
Section 4.2
4.3 True or False? Concurrency is only possible with parallelism. false
4.4 True or False? Amdahl’s Law addresses the disproportionate effect of the serial portion of a program. True
4.5 List at least three challenges when designing programming for multicore systems. identifying tasks balance data splitting data dependency testing and debugging
4.6 What are the two general typesof parallelism? data parallelism and task parallelism
Section 4.3
4.7 List the three common ways of mapping user threads to kernel threads. many-to-one one-to-one and many-to-many
4.8 True or False? Only Linux and Windows implement the one-to-one model. True
Section 4.4
4.9 What are the two approaches for implementing a thread library? Provide the library in the user space with no kernel support or implement a kernel-level library supported directly by the operating system.
4.10 What are the three main thread libraries in use? POSIX, Windows, Java
4.11 True or False? PThreads is typically only implemented on UNIX-like systems. True
4.12 True or False? PThreads is only a specification, not an implementation. True
4.13 What is the PThread API for creating a thread? pthread_create()
4.14 What is the Windows API for creating a thread? CreateThread()
4.15 What Java method is used for allocating and initializing a new thread in the JVM? start()
Section 4.5
4.16 Provide at least two techniques for supporting implicit threading. Thread Pools, OpenMP, Grand Central Dispatch
4.17 True or False? Grand Central Dispatch only works for Apple’s Mac OSX and iOS operating systems. True
Section 4.6
4.18 True or False? The semantics of the fork() system call can vary on multithreaded systems. True
4.19 What are the two scenarios for canceling a target thread? Asynchronous Cancellation, and Deferred Cancellation
4.20 What is the PThreads API for thread cancellation? pthread_cancel()
Section 4.7
4.21 True or False? Windows threads provide both user and kernel stacks. True
4.22 What term does Linux use to refer to a process or a thread? task