Threads

Q. A ___________ is a basic unit of CPU utilization; it comprises a thread ID, a program counter (PC), a register set, and a stack.  

Answers: thread

Q. A thread shares with other threads belonging to the same process its ___________ section, ___________ section, and other operating-system resources, such as open files and signals.  

Answers: code, data

Q. A traditional process has a ___________ thread of control.  

Answers: single

Q. If a process has ___________ threads of control, it can perform more than one task at a time.  

Answers: multiple

Q. Most software applications that run on modern computers and mobile devices are ___________.  

Answers: multithreaded

Q. An application typically is implemented as a separate ___________ with several threads of control.  

Answers: process

Q. An application that creates photo ___________ from a collection of images may use a separate thread to generate a thumbnail from each separate image.  

Answers: thumbnails

Q. A web ___________ might have one thread display images or text while another thread retrieves data from the network.  

Answers: browser

Q. A word ___________ may have a thread for displaying graphics, another thread for responding to keystrokes from the user, and a third thread for performing spelling and grammar checking in the background.  

Answers: processor

Q. Applications can also be designed to leverage processing capabilities on ___________ systems.  

Answers: multicore

Q. Such applications can perform several ___________ tasks in parallel across the multiple computing cores.  

Answers: CPU-intensive

Q. In certain situations, a single application may be required to perform several ___________ tasks.  

Answers: similar

Q. For example, a web ___________ accepts client requests for web pages, images, sound, and so forth.  

Answers: server

Q. A busy web server may have several (perhaps thousands of) clients ___________ accessing it.  

Answers: concurrently

Q. If the web server ran as a traditional ___________ process, it would be able to service only one client at a time, and a client might have to wait a very long time for its request to be serviced.  

Answers: single-threaded

Q. One solution is to have the server run as a single ___________ that accepts requests.  

Answers: process

Q. When the server receives a request, it creates a separate ___________ to service that request.  

Answers: process

Q. In fact, this - method was in common use before threads became popular.  

Answers: process-creation

Q. Process creation is ___________ consuming and resource intensive, however.  

Answers: time

Q. If the new process will perform the same ___________ as the existing process, why incur all that overhead?  

Answers: tasks

Q. It is generally more ___________ to use one process that contains multiple threads.  

Answers: efficient

Q. If the web-server process is ___________, the server will create a separate thread that listens for client requests.  

Answers: multithreaded

Q. When a request is made, rather than creating another ___________, the server creates a new thread to service the request and resumes listening for additional requests.  

Answers: process

Q. Most operating system ___________ are also typically multithreaded.  

Answers: kernels

Q. As an example, during system boot time on Linux systems, several kernel threads are ___________.  

Answers: created

Q. Each thread performs a ___________ task, such as managing devices, memory management, or interrupt handling.  

Answers: specific

Q. The command ___________ can be used to display the kernel threads on a running Linux system.  

Answers: ps -ef

Q. Examining the output of this command will show the kernel thread ___________ (with pid = 2), which serves as the parent of all other kernel threads.  

Answers: kthreadd

Q. Many applications can also take advantage of ___________ threads, including basic sorting, trees, and graph algorithms.  

Answers: multiple

Q. In addition, programmers who must solve contemporary - problems in data mining, graphics, and artificial intelligence can leverage the power of modern multicore systems by designing solutions that run in parallel.  

Answers: CPU-intensive

Q. ___________ an interactive application may allow a program to continue running even if part of it is blocked or is performing a lengthy operation, thereby increasing responsiveness to the user.  

Answers: Multithreading

Q. This quality is especially useful in designing ___________ ___________.  

Answers: user interfaces

Q. Processes can share resources only through techniques such as ___________ ___________ and message passing.  

Answers: shared memory

Q. However, threads share the ___________ and the resources of the process to which they belong by default.  

Answers: memory

Q. The benefit of sharing code and data is that it allows an application to have several different threads of activity within the same ___________ ___________.  

Answers: address space

Q. Allocating memory and resources for process creation is ___________.  

Answers: costly

Q. Because threads share the resources of the process to which they belong, it is more ___________ to create and context-switch threads.  

Answers: economical

Q. Empirically gauging the difference in ___________ can be difficult, but in general thread creation consumes less time and memory than process creation.  

Answers: overhead

Q. Additionally, ___________ ___________ is typically faster between threads than between processes.  

Answers: context switching

Q. The benefits of multithreading can be even greater in a ___________ architecture, where threads may be running in parallel on different processing cores.  

Answers: multiprocessor

Q. A ___________ process can run on only one processor, regardless how many are available.  

Answers: single-threaded

Q. Every process has ___________ or more threads, allowing the same process to perform multiple tasks concurrently.  

Answers: one

Q. Each thread executes ___________ of one another and therefore each thread requires its own stack.  

Answers: independently

Q. A ___________ process or program that has only one thread of control (and so executes on only one core at a time).  

Answers: single-threaded

Q. ___________: A term describing a process or program with multiple threads of control, allowing multiple simultaneous execution points.  

Answers: multithreaded

Q. Earlier in the history of computer design, in response to the need for more computing performance, ___________-CPU systems evolved into multi-CPU systems.  

Answers: single

Q. A later, yet similar, trend in system design is to place multiple computing ___________ on a single processing chip where each core appears as a separate CPU to the operating system (Section Multiprocessor systems).  

Answers: cores

Q. We refer to such systems as ___________, and multithreaded programming provides a mechanism for more efficient use of these multiple computing cores and improved concurrency.  

Answers: multicore

Q. On a system with a single computing core, ___________ merely means that the execution of the threads will be interleaved over time (animation titled Concurrent execution on a single-core system), because the processing core is capable of executing only one thread at a time.  

Answers: concurrency

Q. On a system with multiple cores, however, concurrency means that some threads can run in ___________, because the system can assign a separate thread to each core (animation titled Parallel execution on a dual-core system).  

Answers: parallel

Q. ___________ means all threads make progress on a single-core system as each thread gets to run for a short period of time on the single processing core.  

Answers: Concurrency

Q. ___________ allows two threads to run at the same time as each thread runs on a separate processing core.  

Answers: Parallelism

Q. Notice the distinction between ___________ and parallelism in this discussion.  

Answers: concurrency

Q. A ___________ system supports more than one task by allowing all the tasks to make progress.  

Answers: concurrent

Q. In contrast, a ___________ system can perform more than one task simultaneously.  

Answers: parallel

Q. Thus, it is possible to have ___________ without parallelism.  

Answers: concurrency

Q. Before the advent of ___________ and multicore architectures, most computer systems had only a single processor, and CPU schedulers were designed to provide the illusion of parallelism by rapidly switching between processes, thereby allowing each process to make progress.  

Answers: multiprocessor

Q. Such processes were running ___________, but not in parallel.  

Answers: concurrently

Q. The trend toward multicore systems continues to place pressure on system designers and application programmers to make better use of the multiple computing ___________.  

Answers: cores

Q. Designers of operating systems must write ___________ ___________ that use multiple processing cores to allow the parallel execution shown in the animation titled Parallel execution on a dual-core system.  

Answers: scheduling algorithms

Q. For application programmers, the challenge is to modify existing programs as well as design new programs that are ___________.  

Answers: multithreaded

Q. This involves examining applications to find areas that can be divided into separate, ___________ tasks.  

Answers: concurrent

Q. Ideally, tasks are ___________ of one another and thus can run in parallel on individual cores.  

Answers: independent

Q. While identifying tasks that can run in parallel, programmers must also ensure that the tasks perform ___________ work of equal value.  

Answers: equal

Q. Just as applications are divided into separate tasks, the ___________ accessed and manipulated by the tasks must be divided to run on separate cores.  

Answers: data

Q. The data accessed by the tasks must be examined for ___________ between two or more tasks.  

Answers: dependencies

Q. When one task depends on data from another, programmers must ensure that the ___________ of the tasks is synchronized to accommodate the data dependency.  

Answers: execution

Q. When a program is running in parallel on multiple cores, many different ___________ paths are possible.  

Answers: execution

Q. ___________ and debugging such concurrent programs is inherently more difficult than testing and debugging single-threaded applications.  

Answers: Testing

Q. Amdahl's Law is a ___________ that identifies potential performance gains from adding additional computing cores to an application that has both serial (nonparallel) and parallel components.  

Answers: formula

Q. If S is the portion of the application that must be performed ___________ on a system with N processing cores, the formula appears as follows: speedup≤S+N(1−S)​1​  

Answers: serially

Q. The ___________ portion of an application can have a disproportionate effect on the performance we gain by adding additional computing cores.  

Answers: serial

Q. In general, there are two types of parallelism: data parallelism and ___________ parallelism.  

Answers: task

Q. ___________ parallelism focuses on distributing subsets of the same data across multiple computing cores and performing the same operation on each core.  

Answers: Data

Q. ___________ parallelism involves distributing not data but tasks (threads) across multiple computing cores.  

Answers: Task

Q. Each thread is performing a ___________ operation.  

Answers: unique

Q. Fundamentally, then, data parallelism involves the ___________ of data across multiple cores, and task parallelism involves the distribution of tasks across multiple cores, as shown in Figure 4.2.1.  

Answers: distribution

Q. A ___________ system allows more than one task to run simultaneously.  

Answers: parallel

Q. ___________ involves distributing tasks across multiple computing cores.  

Answers: Task parallelism

Q. ___________: Multiple processing cores within the same CPU chip or within a single system.  

Answers: multicore

Q. ___________: A computing method that distributes subsets of the same data across multiple cores and performs the same operation on each core.  

Answers: data parallelism

Q. ___________: A computing method that distributes tasks (threads) across multiple computing cores, with each task is performing a unique operation.  

Answers: task parallelism

Q. Support for threads may be provided either at the ___________ level, for user threads, or by the kernel, for kernel threads.  

Answers: user

Q. ___________ threads are supported above the kernel and are managed without kernel support, whereas kernel threads are supported and managed directly by the operating system.  

Answers: User

Q. Virtually all contemporary operating systems—including ___________, ___________, and macOS—support kernel threads.  

Answers: Windows, Linux

Q. The -to- model maps many user-level threads to one kernel thread.  

Answers: many-to-one

Q. Thread management is done by the thread ___________ in user space, so it is efficient (we discuss thread libraries in Section 4.4).  

Answers: library

Q. However, the entire process will ___________ if a thread makes a blocking system call.  

Answers: block

Q. Also, because only one thread can access the kernel at a time, multiple threads are unable to run in ___________ on multicore systems.  

Answers: parallel

Q. ___________ threads—a thread library available for Solaris systems and adopted in early versions of Java—used the many-to-one model.  

Answers: Green

Q. The -to- model maps each user thread to a kernel thread.  

Answers: one-to-one

Q. It provides more ___________ than the many-to-one model by allowing another thread to run when a thread makes a blocking system call.  

Answers: concurrency

Q. It also allows multiple threads to run in parallel on ___________.  

Answers: multiprocessors

Q. The only drawback to this model is that creating a user thread requires creating the corresponding ___________ thread, and a large number of kernel threads may burden the performance of a system.


Answers: kernel

robot