Retake exam Flashcards

1
Q

Concurrency

A

Deal with a lot of things at once
* Processed on one core

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

Requirement of mutex

A
  • No deadlock
  • No starvation
  • Thread only for a short time in mutex
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

IORef

A

Mutable variable

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

MVar

A

Synchronised mutable reference with a lock (empty is locked and full is unlocked)

  • No starvation
  • Mutual exclusion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

compare-and-swap

A

Mutable exclusion, deadlock freedom

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

Non-block progress guarantee

A

B < NB < = OF < LF < WF
* Wait free = every thread makes progress regardless of external factors
* Lock free = system as a whole makes progress, but individual threads aren’t guaranteed to complete
* Obstruction free = Thread makes progress if it doesn’t encounter contention from other threads

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

STM (Non blocking)

A

Can solve dining philophers, but can’t solve starvation and contention

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

TMVar

A

Thread blocks on an MVar are woken up in FIFO order

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

Parallelism

A

Dealing with lot’s of things at once
* Processed on multiple cores

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

Array of structures / structure of arrays

A

AOS -> most logical data organisation layout
SOA -> seperate array for each field of structure

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

Task parallelism

A

Problem broken down into seperate tasks, can communicate and synchronise with each other

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

Scheduling

A

Fork-join, divide-and-conquer

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

Data-parallelism

A

Same operation applied to subsets of data

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

GPU

A

Inherently data-parallel task
* Task run the same code
* Cheap to create threads
* Uses parallelism to hide latency
* Threads in the same block can cooperate
* Each thread block constitutes an independent data-parallel task
* Each streaming processor has own shared memory

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

Map

A

Apply same function to each element of a set

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

```

~~~

Stencil

A

Map with access to neighbourhood around element
* Boundary = choose fixed value
* Each thread keeps a copy of neighbours data
* Optimisation = use tiling (previously loaded still in cache

17
Q

Gather

A

Performs independent random reads in parallel
* Requires function from output to input
* Matrix transpose

18
Q

Scatter

A

Independent random writes in parallel
* Function from input to output
* Collisions = multiple values to the same output index
* Scatter is more expensive than gather

19
Q

Embarrasingly parallel

A

Each operation is completely independent from the computation in other threads

20
Q

Fold

A

Combine a collection of elements into a single value (maximum, sum, minimum)
* In order to use parallel function must be associative

21
Q

Scan or prefix

A

Computes partial reductions of an array
* Inclusive = includes current element in parallel reduction
* Exclusive = Scan includes all prior elements
* Scan-then-propagate = result + number for parallelisation

Parallel scan can split into tiles is done in three phases
Chained scans = use only one kernel and synchronise within the kernel

23
Q

Work

A

How to long to execute on a single processor T1

24
Q

Span

A

How to long to execute on an infinite number of processors

25
Q

Efficient / Optimal

A

Efficient -> span is poly-logarithmic and overhead is poly-logarithmic
Optimal -> span is poly-logarithmic and overhead is constant