1/12
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
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
A program designed to mitigate deadlocks is known as BLANK
A program designed to mitigate deadlocks is known as liveness
What are 2 exemplar distinctions of liveness?
Requiring a system to make progress: more work occurring than blocked threads waiting
Threads might have to take turns handling critical section (minimize waiting periods)
You should set BLANK for your mutexes and critical section?
you should set priorities or order of operations for your mutexes
As part of your design, define which BLANK should be acquired first
which mutex should be acquired first
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
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)
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
what causes starvation? (steps?)
The os decides to give one thread more time than the other
other thread continuously misses opportunity to run, cycles blocking and trying
eventually data runs out of range and causes the thread to fail to execute properly
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
when do livelocks occur?
a thread or a set of critical code is designed to communicate and share resources
true or false, livelocks are typically caused by “smart” code
true, typically it is the fault of the programmer trying to prevent livelocks
what are some ways to prevent a livelock?
Establish thread priority (Threads should execute based on priority only (in a hierarchical manner))
Randomization of thread selection via RNG