Chapter 4 Flashcards

1
Q

define thread

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the 4 benefits of threads

A
  1. responsiveness
  2. resource sharing
  3. economy
  4. scalability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

define parallelism

A

performs more than one task simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

define concurrency

A

supports more than one task by allowing all the tasks to make progress, fast switching

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is unintuitive about concurrency and parallelism

A

it is possible to have concurrency without parallelism

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what are the 5 programming challenges

A
  1. identifying tasks : independent tasks
  2. balance : work of equal value
  3. data splitting : tasks divided to run on separate cores
  4. data dependency: tasks synchronized to accommodate the data dependency
  5. testing/debugging
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the two types of parallelism ?

A
  1. data parallelism : distributing same data

2. task parallelism : distributing tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are the three multithreading models

A
  1. one-one
  2. many-one
  3. many-many
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

which multithreading model is the least common and why

A

many-one. multiple threads are unable to run in parallel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

which multithreading model runs in parallel

A

one-one

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

which model doesn’t result in true concurrency

A

many-many

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what are the 2 methods for creating/managing threads

A
  1. user space with no kernel support

2. kernel-level library supported directly by OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

define thread pools

A

a solution to unlimited threads exhausting system resources and space

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are 3 benefits of thread pools

A
  1. servicing a request within an existing thread is faster than waiting to create a thread
  2. thread pool limits # of existing threads
  3. separating task to be performed from creating a task
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what is the flow of pattern of signals

A
  1. signal detected by event occurence
  2. signal delivered to process
  3. once delivered, signal handled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what are the 2 possible signal handlers

A
  1. default signal handler

2. user-defined signal handler

17
Q

what are the 4 options of where a signal should be delivered

A
  1. to which signal applies
  2. every thread in process
  3. certain thread in process
  4. assign a specific thread to receive all signals for the process
18
Q

define thread cancellation

A

terminating a thread before it has completed

19
Q

what are the 2 scenarios of thread cancellation

A
  1. asynchronous cancellation: immediately terminates target

2. deferred cancellation: target thread terminates itself

20
Q

define lightweight process

A

TLP, data structure between user and kernel threads of the many-many or 2 level model

21
Q

what are the steps of the scheduler activations

A
  1. kernel provides an application with a set of LWPs

2. application can schedule user threads onto an available virtual processor

22
Q

what is the purpose of the scheduler activation

A

scheme for communication