Parallel Computing Week 4

0.0(0)
studied byStudied by 1 person
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

What event occurs, given the hypothetical scenario:
You have 2 threads and 2 mutexes, where one thread has a mutex, and another has another. In this scenario, each thread needs both mutexes to run.

A deadlock will occur as threads wait for eachother to finish indefinitely

2
New cards

A program designed to mitigate deadlocks is known as BLANK

A program designed to mitigate deadlocks is known as liveness

3
New cards

What are 2 exemplar distinctions of liveness?

  1. Requiring a system to make progress: more work occurring than blocked threads waiting

  2. Threads might have to take turns handling critical section (minimize waiting periods)

4
New cards

You should set BLANK for your mutexes and critical section?

you should set priorities or order of operations for your mutexes

5
New cards

As part of your design, define which BLANK should be acquired first

which mutex should be acquired first

6
New cards

A scoped lock is a BLANK that provides a mechanism for owning one or more BLANK

a mutex wrapper that provides a mechanism for owning one or more mutexes

7
New cards

Thread death causing a deadlock occurs how?

one thread acquires the lock, but then is lost by some means (infinite loop inside a section, abnormal thread termination)

8
New cards

true or false, we CAN control how much work each thread is doing (i.e. equal distribution of labour among threads)

False, not likely to happen as the OS performs all the scheduling

9
New cards

what causes starvation? (steps?)

  1. The os decides to give one thread more time than the other

  2. other thread continuously misses opportunity to run, cycles blocking and trying

  3. eventually data runs out of range and causes the thread to fail to execute properly

10
New cards

define what a livelock is.

when two or more threads are failing to execute, because two or more threads are responding to eachother to no end, preventing other threads from progressing

11
New cards

when do livelocks occur?

a thread or a set of critical code is designed to communicate and share resources

12
New cards

true or false, livelocks are typically caused by “smart” code

true, typically it is the fault of the programmer trying to prevent livelocks

13
New cards

what are some ways to prevent a livelock?

  1. Establish thread priority (Threads should execute based on priority only (in a hierarchical manner))

  2. Randomization of thread selection via RNG