What is a process?
A process is a running program together with operating-system resources such as a virtual address space and access to files.
Study 3 Threads and Multithreading with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.
What is a process?
A process is a running program together with operating-system resources such as a virtual address space and access to files.
What execution state does each thread maintain independently?
Each thread has its own execution state, including its program counter, CPU registers, and stack.
What do threads in the same process share?
Threads in one process share the process's code, global data, heap, and many process resources.
How does memory isolation differ between processes and same-process threads?
Processes typically have separate address spaces, while threads in one process share an address space. A faulty thread write can therefore affect its fellow threads.
How can multithreading improve responsiveness?
Multithreading can improve responsiveness: one thread can continue working while another waits for input or file access.
What does concurrency mean?
Concurrency is progress on tasks during overlapping periods; on a single core, the operating system can interleave them.
What is a race condition?
A race condition occurs when threads update the same value without coordination, allowing overlapping operations to produce an incorrect result.
What can a blocking system call do in the many-to-one model?
In the many-to-one model, many user threads map to one kernel thread. A blocking system call can stop that kernel thread and prevent the other user threads from running.
What is the main trade-off of the one-to-one model?
In the one-to-one model, each user thread maps to a kernel thread, enabling independent scheduling and potential parallel execution. The trade-off is greater resource use for creating and managing kernel threads.
How does the many-to-many model map user threads to kernel threads?
Many-to-many multiplexes many user threads over a set of kernel threads, allowing more user threads than kernel threads while retaining the potential for parallel execution.
What additional option does the two-level model provide?
A two-level model is a many-to-many variation that also allows some user threads to be bound to particular kernel threads.
What is a thread?
A thread is a sequence of execution within a process. A process can contain one thread or several.