Process Synchronization Flashcards

1
Q

Race Condition

A

Situation where several processes or threads manipulate shared data, and the outcome depends on the execution order

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

To prevent race conditions, concurrent processes must be

A

synchronized

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

Synchronized

A

Ensures that only one process at a time is manipulating the shared variable, operations must be performed atomically

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

Atomic Operation

A

An operation without interruption

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

Where are there significant race conditions?

A

I/O
Variable sharing

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

Critical Section

A

Segment of code in which the process may be changing shared data

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

Solution to critical section problem must satisfy 3 requirements

A

Mutual Exclusion
Progress
Bounded Waiting

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

Mutual Exclusion

A

If a process is in its critical section then no other processes can be executing in their critical sections

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

Progress

A

The decision of which process enters the critical section cannot be postponed indefinitely

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

Bounded Waiting

A

There must be a limit on how many times other processes can enter their critical section after a process requests access

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

We need _ from critical sections

A

Mutual Exclusion

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

Disabling hardware interrupts CS problem

A

Works but not reasonable, not feasible due to the risk of indefinitely blocking other processes

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

Simple lock variable CS problem

A

Suffers from race condition of setting the lock

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

Indivisible lock variable CS problem

A

Works, uses Test and Set Lock (TSL) instruction to prevent race condition. Finds lock at 0 and sets it in one shot

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

no-TSL toggle for two thread CS problem

A

Doesnt have progress, if B is faster than A, will lock itself out of CS. Tries to take turns but doesnt work if one process should enter multiple times before other

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

Petersons no-tsl, no alternation CS problem

A

idk

17
Q

Busy waiting

A

Means the process/thread continuously execute a tight loop until some condition changes

18
Q

Why is busy waiting bad?

A

Waste of CPU time
Paradox of inversed priority

19
Q

Busy waiting basic solution

A

Waiting process needs to block, not keep idling

20
Q

Semaphores

A

Semaphore S can be accessed by two operations
wait()/P(), and signal()/V()

21
Q

Counting semaphore

A

Integer value can range over an unrestricted domain

22
Q

Binary Semaphore

A

Integer value can range only between 0 and 1 aka mutex locks

23
Q
A