Chapter 4 Flashcards
define thread
basic unit of CPU utilization; comprises a thread ID, PC, register set, and a stack. shares its code section, data section, open files, and signals to other threads
what are the 4 benefits of threads
- responsiveness
- resource sharing
- economy
- scalability
define parallelism
performs more than one task simultaneously
define concurrency
supports more than one task by allowing all the tasks to make progress, fast switching
what is unintuitive about concurrency and parallelism
it is possible to have concurrency without parallelism
what are the 5 programming challenges
- identifying tasks : independent tasks
- balance : work of equal value
- data splitting : tasks divided to run on separate cores
- data dependency: tasks synchronized to accommodate the data dependency
- testing/debugging
what are the two types of parallelism ?
- data parallelism : distributing same data
2. task parallelism : distributing tasks
what are the three multithreading models
- one-one
- many-one
- many-many
which multithreading model is the least common and why
many-one. multiple threads are unable to run in parallel
which multithreading model runs in parallel
one-one
which model doesn’t result in true concurrency
many-many
what are the 2 methods for creating/managing threads
- user space with no kernel support
2. kernel-level library supported directly by OS
define thread pools
a solution to unlimited threads exhausting system resources and space
what are 3 benefits of thread pools
- servicing a request within an existing thread is faster than waiting to create a thread
- thread pool limits # of existing threads
- separating task to be performed from creating a task
what is the flow of pattern of signals
- signal detected by event occurence
- signal delivered to process
- once delivered, signal handled
what are the 2 possible signal handlers
- default signal handler
2. user-defined signal handler
what are the 4 options of where a signal should be delivered
- to which signal applies
- every thread in process
- certain thread in process
- assign a specific thread to receive all signals for the process
define thread cancellation
terminating a thread before it has completed
what are the 2 scenarios of thread cancellation
- asynchronous cancellation: immediately terminates target
2. deferred cancellation: target thread terminates itself
define lightweight process
TLP, data structure between user and kernel threads of the many-many or 2 level model
what are the steps of the scheduler activations
- kernel provides an application with a set of LWPs
2. application can schedule user threads onto an available virtual processor
what is the purpose of the scheduler activation
scheme for communication