University of Balamand: Faculty of Sciences CSIS 221 Operating Systems
University of Balamand: Faculty of Sciences CSIS 221 Operating Systems
Faculty of Sciences
CSIS 221
Operating Systems
Emilio Chahine
A1411058
Report 8
Concurrency: Mutual Exclusion and Synchronization
Outline:
1. Distributed Processing
a. Definition
2. Concurrency
a. Definition
b. Key Terms Related to Concurrency (Definition of each)
Atomic Operation
Critical Section
Deadlock
Livelock
Mutual Exclusion
1. Definition
2. Requirements for Mutual Exclusion
Race Condition
Starvation
c. Principles of Concurrency (Brief description)
3. Process Interaction
a. Processes unaware of each other
b. Processes indirectly aware of each other
c. Processes directly aware of each other
4. Semaphores
a. Common Concurrency Mechanisms (Definition of each)
Semaphore
Binary Semaphore
Mutex
Condition Variable
Monitor
Event Flag
Mailboxes/Messages
Spinlocks
b. Performed Operations on Semaphores
Semaphore Initialization
semSignal
semWait
c. Mutual Exclusion Using Semaphores (Description)
d. Producer/Consumer Problem
e. Strong vs. Weak Semaphores
5. Monitors
a. Definition
b. Monitor Synchronization
Condition Variables
1. Description
2. Cwait(c)
3. Csignal(c)
6. Producer/Consumer Problem
a. Solution using Semaphores
b. Solution using Monitors
7. Inter-Process Communication
a. Message Passing (Description)
Primitive Functions
1. Send
2. Receive
Message Communication Combinations
1. Blocking Send, Blocking Receive
2. Nonblocking Send, Blocking Receive
3. Nonblocking Send, Nonblocking Receive
b. Process Addressing Modes
Description
Direct Addressing
Indirect Addressing
8. References
1. Distributed Processing
2. Concurrency
b. Monitor Synchronization
Condition Variables
1. Description: a container of threads that are waiting for a
certain condition.
2. Cwait(c): Suspend execution of the calling process on
condition c. The monitor is now available for use by
another process.
3. Csignal(c): Resume execution of some process blocked
after a Cwait on the same condition. If there are several such
processes, choose one of them; if there is no such process, do
nothing.
6. Producer/Consumer Problem
Primitive Functions
1. Send: The invoking program sends a message to a
process (which may be an actor or object) and relies on
that process and its supporting infrastructure to select
and then run the code it selects.
2. Receive:
the RECEIVE primitive receives a message from a
specified source process.
8. References:
https://www.webopedia.com/TERM/D/distributed_processing.html
https://www.geeksforgeeks.org/g-fact-70/
https://smallbusiness.chron.com/advantages-distributed-data-processing-
26326.htm
http://www.cs.fsu.edu/~xyuan/cop5611/lecture7.html
https://stackoverflow.com/questions/34510/what-is-a-race-condition
https://www.quora.com/What-does-%E2%80%98starvation%E2%80%99-mean-
in-operating-systems
https://searchoracle.techtarget.com/definition/concurrent-processing
https://en.wikipedia.org/wiki/Monitor_(synchronization)
https://en.wikipedia.org/wiki/Semaphore_(programming)
https://www.webopedia.com/TERM/M/mutex.html
https://doc.micrium.com/display/osiiidoc/Event+Flags
http://www.personal.kent.edu/~rmuhamma/OpSystems/Myos/mutualExclu.htm
http://www.on-time.com/rtos-32-docs/rtkernel-32/programming-
manual/module/mailbox.htm
https://www.definitions.net/definition/spinlock
http://www.logicio.com/HTML/semsignal.htm
https://smallbusiness.chron.com/advantages-distributed-data-processing-
26326.html
https://searchoracle.techtarget.com/definition/concurrent-processing
http://www.personal.kent.edu/~rmuhamma/OpSystems/Myos/mutualExclu.htm