Lesson 4c Flashcards

parallel systems

1
Q

what is barrier sync?

A

threads will wait until all of them reach a defined point

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

What is a centralized barrier or counting barrier?

A

We set N to the number of threads. When each thread reaches the barrier the count is atomically decremented and the thread spins until reaching 0

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

What is a potential problem of the centralized barrier?

A

We don’t want to wake up waiting threads (leave the barrier) until count is reset to the number of threads. If we don’t then other barriers could be passed

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

what is the correct code for the barrier when N = 0?

A
if c = 0
c := N;//last processor to arrive
else
while(c > 0);
while(c != n);//don't leave the barrier until N is reset
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What problem is the sense reversing barrier solving for?

A

The two spin loops that the counting barrier has

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

What does the sense variable control?

A

It switches between true and false as borders are crossed. s=t | s=f | s=t | s=f in this case for barrier b1, b2, b3, b4

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

what do we spin on?

A

sense reversal

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

What is the problem with centralized barrier?

A

The counting variable causes a log of contention on the network

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

How do we avoid the centralized contention

A

divide and conquer “Tree Barrier”

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

What information is in the non-leaf nodes?

A

count and lock sense

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

what are in the leaf nodes

A

the processes

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

what do the leafs do when a barrier is reached?

A

they walk up the tree decrementing the count. If the count = 0 go to parent.

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

what happens when the root node reaches zero?

A

all processes are at the barrier. Set count to number braches, flip the lock sense and move down the tree. When the sense is flipped the processes will eventually wake up

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

What is the benefit of tree barrier?

A

Less contention since we have many variables

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

Is the locksense flag statically or dynamically determined

A

Dynamic. It is determined by the arrival of the process in the tree

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

what is NUMA

A

non-uniform memory access (distributed memory)

17
Q

what kind of barrier is mcs?

A

Tree-Barrier (4-ary arrival)

18
Q

what are the two data structures in MCS

A

HC - Have Children, CN - children not ready (signal-parent)

19
Q

What is a benefit of the HC data structure

A

since they are bits they can be packed into one word and can then spin on everybody

20
Q

what kind of tree is mcs barrier’s wakeup tree

A

a binary tree

21
Q

are the locations of processes static or dynamic in the mcs wakeup and arrival tree?

A

static

22
Q

In a tournament barrier how many rounds do you have

A

N players log2N rounds

23
Q

the first round is fixed, why?

A

the node on the left will always win between it and the right node. It makes it convenient to find the spin location in memory

24
Q

what happens at the end of the tournament

A

the winners shakes hands with the loser. When all handshakes have taken place everyone is awake and the barrier is done.