mirror of
https://github.com/dholerobin/Lecture_Notes.git
synced 2025-03-15 13:49:59 +00:00
fix image urls
This commit is contained in:
parent
a51b7b8e5f
commit
d00a8d8bb8
@ -70,7 +70,7 @@ Critical Section
|
||||
|
||||
Use smaller atomic operation to create large, custom atomic operation
|
||||
|
||||

|
||||

|
||||
|
||||
-- --
|
||||
|
||||
@ -100,7 +100,7 @@ Opposite - starvation
|
||||
Peterson's Solution
|
||||
-------------------
|
||||
|
||||

|
||||

|
||||
|
||||
- flag: tells the other guy to wait
|
||||
- turn: to prevent a deadlock where everyone is waiting. Ensures that atleast 1 is running CS.
|
||||
@ -110,11 +110,11 @@ Peterson's Solution
|
||||
MuteX
|
||||
-----
|
||||
|
||||

|
||||

|
||||
|
||||
Note: aquiring and releasing locks is atomic
|
||||
|
||||

|
||||

|
||||
|
||||
cons: busy wait - splinlocks
|
||||
pros: no context switch
|
||||
@ -125,9 +125,9 @@ Semaphores
|
||||
- integer variables
|
||||
- wait and signal, both atomic, only 2 operations defined
|
||||
|
||||

|
||||

|
||||
|
||||

|
||||

|
||||
|
||||
Note that S++, S-- is atomic here
|
||||
On single processors this can be implemented by disabling interrupts during the execution of wait and signal; Multiprocessor systems have to use more complex methods, including the use of spinlocking.
|
||||
@ -135,7 +135,7 @@ On single processors this can be implemented by disabling interrupts during the
|
||||
Binary Semaphore -> Mutex
|
||||
-------------------------
|
||||
|
||||

|
||||

|
||||
|
||||
Counting Semaphore
|
||||
------------------
|
||||
@ -148,7 +148,7 @@ Integer values
|
||||
Resource Allocation graph & Deadlocks revisited
|
||||
-----------------------------------------------
|
||||
|
||||

|
||||

|
||||
|
||||
Conditions
|
||||
1. Mutual Exclusion
|
||||
@ -157,7 +157,7 @@ Conditions
|
||||
4. Circular Wait
|
||||
|
||||
|
||||

|
||||

|
||||
|
||||
no cycle = no deadlock
|
||||
cycle and only one of each resource = deadlock
|
||||
@ -223,4 +223,4 @@ sem.release()
|
||||
|
||||
[Semaphore (Java Platform SE 7 )](https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Semaphore.html)
|
||||
|
||||
[Semaphores](http://tutorials.jenkov.com/java-concurrency/semaphores.html)
|
||||
[Semaphores](http://tutorials.jenkov.com/java-concurrency/semaphores.html)
|
||||
|
Loading…
x
Reference in New Issue
Block a user