32: Common Concurrency Problems

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There are no tags or description

Looks like no tags are added yet.

25 Terms

1
New cards

MySQL, Apache, Mozilla, OpenOffice

types of bugs exist, focus on four major open-source applications

2
New cards

Non Deadlock Bugs

make up a majority of concurrency bugs

3
New cards

Atomicity Violation Bugs

the desired serializability among multiple memory accesses is violated

4
New cards

Add locks

solution to atomicity violation bugs, simply _ _ around the shared-variable reference

5
New cards

Order Violation Bugs

the desired order between two memory accesses is flipped

6
New cards

Condition Variables

solution to order violation bugs, enforce ordering using _ _

7
New cards

Deadlock Bugs

the presence of cycle

8
New cards

Complex Dependencies

in large code bases, _ _ arise between components, why do deadlocks occur? (1)

9
New cards

Encapsulation

due to the nature of _, why do deadlocks occur? (2)

10
New cards

Mutual Exclusion

threads claim exclusive control of resources that they require

11
New cards

Hold and Wait

threads hold resources allocated to them while waiting for additional resources

12
New cards

No preemption

resources cannot be forcibly removed from threads that are holding them

13
New cards

Circular wait

there exists a circular chain of threads such that each thread holds one more holds one more resources that are being requested by the next thread in the chain

14
New cards

Cannot occur

if any of these four conditions are not met, deadlock _ _

15
New cards

Circular Wait

provide a toral ordering on lock acquisition

16
New cards

Global locking strategies

circular wait, this approach requires careful design of _ _ _

17
New cards

Hold and Wait

acquire all locks at once, atomically

18
New cards

Decrease concurrency

hold-and-wait problem

19
New cards

No Preemption

multiple lock acquisition often get us into trouble because when waiting for one lock we are holding another

20
New cards

Trylock()

used to build a deadlock-free, ordering-robust lock acquisition protocol

21
New cards

Trylock()

grab the lock (if it is available, or return -1: you should try again later)

22
New cards

Livelock

two threads might be running through the code sequence (acquiring the lock) over and over again but failing to acquire the lock

23
New cards

Livelock

progress is not being made through

24
New cards

Random delay

livelock solution, add a _ _ before looping back and trying the entire thing over again

25
New cards

Lock-free, wait free

using powerful hardware instructions (atomic)