OS-Unit3 Quick Guide
OS-Unit3 Quick Guide
me/jntuh
2. Synchronization Hardware
Hardware Support: CPUs provide atomic instructions and hardware primitives to
facilitate synchronization.
Atomic Operations: These operations are indivisible and cannot be interrupted.
Examples include test-and-set, compare-and-swap, and fetch-and-add.
Memory Barriers: Instructions that enforce ordering of memory operations to
ensure visibility of changes across different threads or processes.
Cache Coherence Protocols: Ensure consistency of shared data across multiple
processor caches in a multiprocessor system.
4. Critical Regions
Critical Region: A section of code where shared resources are accessed.
Entry Section: The part of the code where a process requests entry to its critical
section.
Exit Section: The part of the code where a process exits the critical section.
Entry Protocol: Rules or mechanisms governing access to critical regions.
Implementations: Can be implemented using semaphores, mutexes, or other
synchronization primitives provided by the operating system.
5. Monitors
Monitor: A high-level synchronization construct that combines data and
procedures that operate on the data.
Properties:
Mutual Exclusion: Only one process can be active in the monitor at any given
time.
Condition Variables: Mechanism for processes to wait for certain conditions
to become true.
Synchronization: Ensures that shared data is accessed in a safe and
coordinated manner.
Advantages: Provides a structured approach to concurrency, encapsulating data
and synchronization mechanisms within a single construct.
1. Pipes
Characteristics:
Data written to one end of the pipe can be read from the other end.
Limited to communication between related processes, such as parent and
child processes.
2. Message Queues
3. Shared Memory
1. Sockets