Race Conditions & Locks Flashcards

1
Q

Mutual Exclusion

A

limits access to a shared resource to one thread at a time; guarantees atomicity!!!

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

Race Condition

A

condition where incorrect program output may be generated depending on the interleaving of instructions from multiple threads

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

Critical section

A

the section of code that accesses shared resources

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

Locks

A

thread synchronization mechanism that achieves mutual exclusion

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

Atomic operation

A

program operations that run completely independently of any other processes

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

Synchronization

A

a mechanism to ensure multiple loci do not simultaneously access the shared resources

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

Shared Resource

A

anything of interest; represented in memory, so we can talk in terms of shared variables

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

What is a deterministic ?

A

for the same input, the same output

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

Correct output

A

any output from interleaving mutltiple threads is the same as an output from executing the threads sequentially; whatever output threads execute sequentially

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

Atomicity of critical section

A

only one thread is in the critical section, and that thread must finish before another enters the critical section

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

Benefits of synchronization

A

what you can do when outside of the bits where you are forced to be synchronised, and that other threads are free to go about their business if they aren’t accessing that variable

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

Atomic Code

A

code that is executed by a thread invisibly from the point of view of other threads trying to execute the same code;

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