TM - Distributed Systems Flashcards

(39 cards)

1
Q

What is a Distributed System

A

Several Distributed components under a single system.

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

Features of a Distributed System

A

Can communicate with a message. Typically executed concurrently and autonomously. Coordinated through a computer network. Physically close or geographically distant. Memory can be shared or individual. Communication slow and unreliable.

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

Examples of a Distributed System

A

The WWW, Online Games, An Office Network.

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

Why build a Distributed System

A

Some problems are distributed by nature. Cost, Performance, Availability (Fault tolerant), Physical/Geographic Reasons.

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

Multithreading

A

Multiple threads of execution in a single app. Threads =/= cores.

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

Example of why use multithreading

A

UI apps can block while waiting for user input, this blocked work can execute on another thread.

Also video games use multithreading to render frames.

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

Fork-Join Model

A

Parallel Programming Paradigm. Threads can be executed separately but logic is not always independent and can cause interleavings.

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

Fork (Fork-Join)

A

Divides the task into smaller subtasks, creating parallel threads or processes to handle them

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

Join (Fork-Join)

A

Gathers results from parallel threads or processes and combines them for the final result.

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

Restricting possible interleavings

A

Race Condition. Atomic Actions. Critical Sections. Mutual Exclusion.

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

Race Condition

A

Occurs when the app behaviour depends on the timing of execution sequences in a multithreaded environment.

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

Atomic Action

A

An action to be executed as one unit

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

Critical Section

A

Group of instructions to be executed atomically. Executed by a single process at a time (Mutually exclusive).

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

Mutual Exclusion

A

One thread of execution never enters its critical section at the same time that another thread in execution is entering its critical section.

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

Lock

A

A synchronization tool used to control resource access from multiple threads of execution. Relies on using lock() and unlock().

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

Issues with Lock

A

Deadlock, Livelock, Starvation

17
Q

Deadlock

A

No process can progress because each is waiting for a resource held by another.

18
Q

Livelock

A

No process can progress because process is continuously changing state in response to changes in other processes without doing useful work.

19
Q

Starvation

A

Some process cannot get its chance to progress (overlooked by scheduler due to bad luck or low priority).

20
Q

Creating a Parallel Program (4 Steps)

A
  • Decompose computation into tasks
  • Assign tasks to processes
  • Orchestrate data access, communicate, synchronize
  • Map processes to processors
21
Q

Speedup

A

improvement in the overall performance or execution time of a task when processing is distributed

22
Q

Reasons against programs being able to execute in parallel

A

Performing Initialization
Communicating amongst processes
Resource Contention
Load Imbalance

23
Q

Client-Server Pattern

A

Server running program waiting for client request.
Client process submitting requests and getting response from server.
Both can work on a single machine or a distributed system.

24
Q

Two Main Classes of Servers

A

Iterative
Concurrent

25
Iterative Class of Server
Clients are blocked while a client is being served
26
Concurrent Class of Server
Time slicing applied by CPU, each processor given time to a client.
27
Client Server Challenges
Interoperability on development platforms. Address space and referencing remote objects.
28
Java remote method invocation
Allows object to invoke a method from another JVM. Limited in cross platform combatibility as only works from JVM to JVM
29
COM/OLE
Component Object Model/Object Linking and Embedding. Standard interface for Microsoft software components. COM is base of OLE.
30
Web Services
Use of existing infrastructure to enable development of client apps composed of web services (i.e services of remote objects) implemented on remote hosts.
31
Remote Procedure Call (RPC)
Procedure executed in a different address space than the one invoking it (used in client-server).
32
Execution order
Synchronous (Thread executed block until it's complete) Asynchronous (Thread executing current task proceeds with execution even if task is not complete). Completion Notified through call block.
33
Microservices architecture
Organize around business processes. Decentralized. Infrastructure support + Continuous Delivery. Operate despite failure, not necessarily innovative. Challenging to understand complex sequences across certain microservices.
34
Serialization
Transform state of objects into stream of bytes for consumption such that it can be rebuilt as an object with the same stream.
35
Formats of serialization
XML - human readable don't need to know schema + more verbose than JSON JSON - human readable don't need to know schema + less verbose than XML Protobuf, Thrift.. - Not human readable, smaller output, faster processing, schema known in advance.
36
Multiple clients working with same resource
Stale Data, Pessimistic Locking, Optimistic Locking
37
Stale Data
Data which has changed since being retrieved by the current process
38
Pessimistic Locking
Resource locked as soon as it is accessed and released as soon as changes committed. Prevents conflicts.
39
Optimistic Locking
Resources can be read and changed freely. Check for conflict when committing changed result and act according to specified conflict resolution protocol. Avoids overhead of locking resource for a long period of time.