CSA Flashcards

1
Q

What does “embarrassingly parallelisable” mean?

A

A task can be parallelised without any information needing to be exchanged between threads.

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

What is a mutual exclusion?

A

Only one thread is allowed to access some data at a given time, it must have acquired a lock on the data.

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

How does a channel work in Go?

A

Shared memory with a mutex protecting it. Sender locks before writing data, and receiver locks before deleting the data.

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

Flow of TCP/IP layers

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

What is the TCP/IP Application layer?

A
  • Used by the applications the user is interacting with.
  • Defines protocols for using the network, error handling and recovery
  • HTTP/S, FTP, DNS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

TCP/IP Transport layer

A
  • First layer that breaks down messages into packets
  • Common features: reliability, flow control
  • TCP/UDP/QUIC
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

TCP/IP Internet layer

A
  • Responsible for routing packets through an internet
  • Decide next hop a packet needs to take
  • Handle errors in packet transmission
  • Reassembles packets at destination
  • IPv4/IPv6
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

TCP/IP Link layer

A
  • Concerns the network layer that is physically connected
  • Protocols to convert data to signals along wires
  • Protocols to handle ethernet/wifi/etc
  • E.g. MAC Addresses
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is livelock?

A

When a distributed program descends into an endless sequence of interaction with different components of itself, excluding interaction with the outside world.

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

What is the general idea of CSP?

A

Reduce the description of a program to only its interactive behaviours.

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

What is a CSP process?

A
  • Independent, sequential entity
  • Engage in events (operations visible to the environment)
  • May communicate with other processes via common events
  • Completely described by their possible event sequences
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are primitive processes?

A

Represent fundamental, predefined behaviours such as:

  • STOP (process that communicates nothing e.g. deadlock)
  • SKIP (process that terminated succesfully)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are events?

A

Represent visible behaviours of a process (e.g. communications) which are atomic and instantaneous.

The set of all possible atomic events of a process P is its alphabet (or interface) written as α(P)

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

What is prefixing?

A

Describing a process as an event followed by another process e.g:

SVM = coin -> STOP
SVM = coin -> (choc -> STOP)

For convenience we sometimes leave out the brackets, but do this ONLY when no strict CSP is asked for.

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

What is a choice?

A

A choice describes alternate paths a process can take e.g:

Wait = green -> Walk | red -> Wait

Choices can be made amongst any finite number of events.

Choices are either internal (made by the process) or external (made by the environment).

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

How do we describe multiple choices from an alphabet?

A

P = x: A → P(x) given A = {a1 ,…, an} means P can perform any event x from A

Read as ”x from A then P of x”.

17
Q

How do we sequentially compose processes?

A

P; Q performs P until P terminates with SKIP and then performs Q

18
Q

What is a trace?

A

A finite sequence of events, representing a particular behaviour of a process up to a point in time.

Written as comma-separated list of events, enclosed in angle brackets e.g:

<coin, choc, coin, sweet>

The set of all possible traces of a program is called traces e.g. traces(p)

19
Q

What is the trace refinement relation?

A

P refines to Q (P ⊑T Q) if and only if traces(P) is a superset of traces(Q). That is to say that Q exhibits at most the behaviour exhibited by P, possibly less.

20
Q

How do common events work?

A

An event common to two processes’ alphabets must be offered by both processes at the same time in order to occur and are then offered as one event.

21
Q

What is the number of states in a combined process P||Q?

A

If P and Q are independent, there are |P|*|Q| states.

22
Q

What is P/tr?

A

The process whose behaviour is whatever P could do after the trace tr has been observed.

23
Q

What are refusals?

A

The refusals of a state are the events which cannot occur at that time without causing a deadlock.

24
Q

What are failures?

A

Failures are pairings of traces to refusals.

25
Q

How do we represent an external choice?

A

P☐Q does either P or Q depending on an external choice (usually which process ended up processing the event first).

Permits choices with the same event in multiple branches e.g. (a -> P ☐ a -> Q) which cannot be written as (a -> P | a -> Q).

26
Q

How do we represent an internal choice?

A

P⊓Q does either P or Q depending on an internal choice to the program that cannot be influenced by the environment. For example P = a -> b -> STOP ⊓ b -> STOP

An example is a mail router which may choose the route to send mail along depending on network traffic where the end-user doesn’t care which route the mail takes.

The trace of an internal choice always does the invisible event 𝜏 first.

27
Q

What does 𝜏 mean?

A

A silent transition internal to the program that cannot be seen by the environment

28
Q

What is the set initials(P)?

A

The set of initial events that can be emitted by P

29
Q

What is a divergent process?

A

A process which may enter an infinite loop of internal decisions, preventing it from ever interacting with the environment again.

We can avoid them by specifying failure traces called divergences which are finite traces during or after which an infinite loop may occur.

30
Q

What are the four conditions of a deadlock?

A

Mutual Exclusion - Agents claim exclusive control of the resources they require
Wait For - Agents hold resources already allocated to them while waiting for more resources
No Preemption - Resources cannot be forcibly removed from the agent holding them until the resources are used to completion
Circular Wait - A circular chain of agents exist where each agent holds one or more resources that are being requested by the next agent in the chain

31
Q

What is a vector clock?

A

Each process holds a vector of the current timestamps of each process. It updates its vector whenever it receives a message from another process. It chooses which vector element is correct by which is highest.