Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
32 Cards in this Set
- Front
- Back
Why allow cooperating processes/threads? |
§ Speedup – overlap I/O and Computation, take |
|
Why are cooperating processes important? |
Need to ensure correct operation with concurrent processes/threads |
|
why can Cooperating processes affect each other’s execution? |
They share a logical address space or share data through files and messages |
|
Why can Concurrent access to shared data result in intermittent incorrect behavior? |
Because the outcome may be affected by concurrency or interleaving of the execution |
|
Scheduling order does not affect operation |
Independent processes |
|
Shared state between threads, scheduling order can affect operation without proper synchronization among processes/threads |
Cooperating processes/threads |
|
When several processes access and |
Race Condition |
|
What should happen to ensure correct operation in certain code sequences? |
They should be uninterruptable and/or should |
|
Why are race conditions bad? |
Race conditions lead to non-deterministic behavior |
|
How can race conditions be avoided? |
Ensure that only one of process |
|
Ensuring that only one thread does a |
Mutual Exclusion (One thread excludes the others while doing its task) |
|
Piece of code that only one thread can |
Critical Section (requires mutual exclusion ) |
|
What requirements should be satisfied by a solution to the critical section problem? |
Mutual Exclusion Progress Bounded waiting |
|
If no process is executing in its critical section and some processes wish to enter their critical sections, then only those processes that are looking to enter their critical sections decide |
Progress |
|
There must exist a bound on the number of |
Bounded waiting (avoid starvation) |
|
Use a turn variable to signal whose turn it is to enter the critical section as well as a flag per process that indicates whether a process wants to enter its critical section |
Peterson’s Algorithm |
|
Locking mechanism to |
Disabling Interrupts /* disable interrupts */ /* enable interrupts */ |
|
Problems with disabling interrupts |
§ Does not guarantee mutual exclusion for multiprocessor systems (disabling interrupts across multiprocessors is expensive; message passing) |
|
Use a variable to lock access to critical section (needs to be an atomic operation ) |
Lock Variables |
|
Problems with Lock variables approach |
•Busy waiting is employed |
|
Problems with Busy Waiting |
• Very inefficient because waiting process |
|
§ Priority Inversion for Strict Priority Scheduler |
• If busy-waiting thread has higher priority than |
|
Integer that is accessed through two |
Semaphores |
|
Problems with semaphores |
§ A process will busy wait or spin waiting for the semaphore (this type of semaphore is also referred to as a spinlock) |
|
Binary semaphore |
only two values (0, 1) |
|
Used when there are a finite number of instances of some resource |
Counting semaphore |
|
Who and in which year were semaphores introduced? |
Edsgar Dijkstra in the late 1960s |
|
How can busy waiting be fixed? |
changing implementation of |
|
Since processes are queued as they wait on a semaphore, name one |
Process Scheduling |
|
• P0 executes wait(S) and acquires this semaphore
|
Example of Deadlock since neither process will be receive the signal() they are waiting for |
|
Allow a process to inherit |
Priority Inheritance |
|
A lower priority process M, is able to affect the |
Priority Inversion |