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