Linearizability and Sequential Consistency Flashcards

1
Q

What does a method call consist of? Histories

A

A method call consists of a method invocation and response

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

What is an invocation without matching response called?

A

pending

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

What is a history?

A

a finite sequence of method invocations and responses

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

what is a subhistory?

A

a subsequence of the events of a history

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

What does complete(H) consist of?

A

the subsequence of a history H consisting of all matching invocation and response events in H.

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

When is a history sequential?

A

if every invocation is immediately followed by a matching response, i.e. when no method calls overlap

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

Name the parts of invocation and response in a history.

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

Match the invocations and responses. Are there any pending invocations?

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

What are object nad thread projections of the image?

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

When are histories equivalent?

A

When the per thread projections are equal. see image

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

When does one method call precede another?

A

When the response event precedes the invocation event.

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

What 2 requirements mus a program fullfill to be sequentialy consistent?

A

1) Method calls schould appear to happen in a one-at-a-time, sequential order. Every method call returns before the next one starts.
2) Method calls should appear to take effect in program order. This means that we can order all method calls such that they

a) are consistent with respect to the program order, i.e. they adhere to the ordering imposed
by the thread subhistories

b) meet the object’s sequential specication

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

Check whether the history is sequentially consistent.

A

first requirement: method calls happen in a one-at-a-time, sequential order (every subhistory is a sequential history)

How do we check this? Check if in HjA (projection H to thread A) and HjB (projection H to thread B) each method call finishes before the next one starts.

Second requirement: find a method call ordering such that they are consistent with programm order.

How do we check this?
One such order is given by
s.push(1) –> s.push(2) –> s.pop() =2 –> s.pop()-=1

not the only possibility another order is:
s.push(2) –> s.push(1) –> s.pop()=1 –>s.pop()=2

It just need to be correct with the push and pops

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

Whats the rule to linearizability? informal by word

Tipp: Idea is that the concurrent history is equivalent to some sequential history.

A

if one method call precedes another, then the earlier call must have taken effect before the later call. By contrast, if two method calls overlap, then their order is ambigous, and we are free to order them in any convenient way.

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

Definition of linearizability

Start with a history H is linearizable if….

A

A history H is linearizible if it has a extension H’ such taht H’ is complete and there is a legal sequential history S such that

1) complete(H’) is equivalent to S, and
2) if method call 0 in H precedes method call 1, then method call 0 in S precedes method call 1

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

Another definitnion of linarizibilty using subhistories

A

H is linearizable if, and only if, for each object x, Hjx (projection of x in H) i.e. the subhistory of H with only all method calls concerning object x, is linearizable.

17
Q

What does the picture say about linearibility?

A

The first SELECT statement reads the value of 50, while the second SELECT reads the value of 10 since in between the two read operations a write operation was executed.

Linearizability means that modifications happen instantaneously, and once a registry value is written, any subsequent read operation will find the very same value as long as the registry will not undergo any modification.

18
Q

What isthe idea of consensus?

Tipp: notion of how strong a certain synchronization primitive, such as TAS, is.

A

First off the consensus number of primitive is only used for proofs

Each class in the hierarchy has an associated consensus number, which is the maximum number of threads for which objects of the class can solve an elementary synchronization problem called consensus.

19
Q

What is the consensus problem?

A

ou have N processes. Every thread gets to propose a value, then the threads should decide on one and the same of these proposed values.

20
Q

What are valid outcomes of the consensus problem in following scenario:

Thread A suggests value A, Thread B suggests value B.

A

Then the valid outcomes are that either both threads decide A, or that both threads decide B.

21
Q

There are different special objects or operations that are useful in solving consensus problems. What does the consensus number say about them?

A

The powerfulness of a special object is graded by their consensus number. This equals the maximum number of threads for which they can solve the consensus problem.

Remember consensus problem: all threads decide on the same value

22
Q

Give example for:

Consensus number 1
Consensus number 2
Consensus number infinity

A

1: Normal read/write registers. (That is, plain variables.)
2: Test & set (a.k.a. compare & set), queue, stack et.c.
infinity: Compare & Swap

23
Q

What consensus number do atomic registers have?

A

1 (They can solve the consensus problem only for one thread)

24
Q

What is part of the consensus problem and what methods are used in it? How does the consensus problem play out?

A

A consensus object provides a single method decide(). Each thread calls the decide() method with its input v (v is a value every thread has a different one they want to agree on one) once. The objects decide() method (decision of every thread) will then return a value meeting the following conditions:

consistent: all threads decide the same value
valid: the common decision value is some thread’s input

25
Q

I := Invoke R:= Response
Just 1 thread
H_S : I1 R1 I2 R2 I3 R3

What can we say about this history

A

Its a sequential history hence a sequence of events of which each Invoke is followed instantaneously by its ceorresponding Response.

There is no concurrency here there is just 1 thread