What is a thread, in the context of operating systems?
A thread is a basic unit of CPU utilization within a process.
What are the four components that comprise a thread?
A thread ID, a program counter (PC), a set of registers, and a stack.
What three primary sections of a process do its threads share by default?
The code (text) section, the data section, and the heap section.
Besides memory sections, what other operating system resources do threads of the same process share?
Other OS resources, such as open files and signals.
What is the key difference between a single-threaded process and a multithreaded process in terms of components?
A multithreaded process has multiple sets of registers, stacks, and program counters, one for each thread.
What is the ‘Responsiveness’ benefit of multithreading?
It may allow an interactive application to continue running even if part of it is blocked or performing a lengthy operation.
How do threads within a process share resources by default?
Threads share the memory and resources of the process to which they belong automatically.
In contrast to threads, what techniques must processes use to share resources?
Processes must use techniques explicitly arranged by the programmer, such as shared memory and message passing.
What is the ‘Cost’ benefit of using threads compared to processes?
It is more economical to create and context-switch threads because they share resources.
How does thread creation compare to process creation in terms of time and memory?
In general, thread creation consumes less time and memory than process creation.
How does context switching between threads compare to context switching between processes?
Context switching is typically faster between threads than between processes.
What is the ‘Speed’ benefit of multithreading, especially on a multiprocessor architecture?
Threads may run in parallel on different processing cores, increasing performance.
How many processors can a single-threaded process utilize, regardless of how many are available?
A single-threaded process can run on only one processor.
A recent trend in system design is to place multiple computing cores on a single processing chip, which leads to _____ systems.
multicore
How does multithreaded programming relate to the efficient use of multi-core systems?
It provides a mechanism for more efficient use of these systems by allowing parallel execution.
On a system with a single computing core, what does concurrency mean for the execution of threads?
It means the execution of the threads will be interleaved over time.
On a system with multiple cores, what does concurrency mean for the execution of threads?
It means that some threads can run in parallel, with the system assigning separate threads to each core.
What does it mean for a system to be ‘concurrent’?
A concurrent system supports more than one task by allowing all tasks to make progress.
What does it mean for a system to be ‘parallel’?
A parallel system can perform more than one task simultaneously.
What is the relationship between parallelism and concurrency?
Parallelism is a special case of concurrency.
Are all parallel systems concurrent? Why or why not?
Yes, because by performing tasks simultaneously, they allow multiple tasks to make progress.
Are all concurrent systems parallel? Why or why not?
No, as some may achieve concurrency by switching between tasks without executing them at the same time.
How did single-core computer systems provide an ‘illusion of parallelism’?
CPU schedulers would rapidly switch between processes, allowing each process to make progress concurrently.
What is the ‘Identifying tasks’ challenge in multicore programming?
It involves examining applications to find areas that can be divided into separate, concurrent tasks.