0% found this document useful (0 votes)
2 views4 pages

OS-Unit3 Quick Guide

OS R22 JNTUH UNIT-3

Uploaded by

vanisrirao2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views4 pages

OS-Unit3 Quick Guide

OS R22 JNTUH UNIT-3

Uploaded by

vanisrirao2025
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

www.android.universityupdates.in | www.universityupdates.in | https://telegram.

me/jntuh

Process Management and Synchronization


1. The Critical Section Problem
Definition: The critical section problem deals with concurrent access to shared
resources by multiple processes or threads.
Objective: Ensure that concurrent processes do not interfere with each other while
accessing shared resources, maintaining data consistency and integrity.
Requirements:
Mutual Exclusion: Only one process can execute its critical section at a time.
Progress: If no process is executing in its critical section and some processes
wish to enter, only those processes not excluded should decide which will
enter next, and this decision cannot be postponed indefinitely.
Bounded Waiting: There exists a limit on the number of times other
processes are allowed to enter their critical sections after a process has made
a request and before that request is granted.

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.

3. Semaphores and Classical Problems of Synchronization


Semaphore: A synchronization construct introduced by Dijkstra, consisting of an
integer variable and two atomic operations: wait (P) and signal (V).
Binary Semaphore: Used for mutual exclusion.
Counting Semaphore: Used for general synchronization.
Classical Synchronization Problems:
Producer-Consumer Problem
Readers-Writers Problem
Dining Philosophers Problem

www.android.previousquestionpapers.com | www.previousquestionpapers.com | https://telegram.me/jntuh


www.android.universityupdates.in | www.universityupdates.in | https://telegram.me/jntuh

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.

Interprocess Communication Mechanisms


IPC between Processes on a Single Computer System
Interprocess communication (IPC) mechanisms enable processes running on the same
computer system to communicate and share data efficiently. Several mechanisms
facilitate IPC:

1. Pipes

Definition: Pipes are a method of IPC that allow communication between


processes in a unidirectional manner.
Types:
Anonymous Pipes: Created using the pipe() system call and are typically
used for communication between parent and child processes.
Named Pipes (FIFOs): Exist in the file system and can be accessed by
unrelated processes for communication.

www.android.previousquestionpapers.com | www.previousquestionpapers.com | https://telegram.me/jntuh


www.android.universityupdates.in | www.universityupdates.in | https://telegram.me/jntuh

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

Definition: Message queues provide a communication mechanism for processes


to exchange data in the form of messages.
Features:
Allow communication between unrelated processes.
Messages are stored in queues and can be retrieved based on their priority.
Provide a flexible and efficient means of IPC for processes needing to
exchange structured data.

3. Shared Memory

Definition: Shared memory allows multiple processes to access common regions


of memory.
Characteristics:
Processes can read from and write to shared memory segments.
Provides a high-speed communication mechanism as data is directly
accessible in memory.
Requires synchronization mechanisms (e.g., semaphores) to manage
concurrent access to shared resources.
Suitable for scenarios where processes need to exchange large amounts of
data frequently.

IPC between Processes on Different Systems


Interprocess communication between processes on different systems involves
communication across a network. Common mechanisms for IPC between processes on
different systems include:

1. Sockets

Definition: Sockets are endpoints for communication between processes across a


network.
Features:
Enable bidirectional communication between processes running on different
systems.

www.android.previousquestionpapers.com | www.previousquestionpapers.com | https://telegram.me/jntuh


www.android.universityupdates.in | www.universityupdates.in | https://telegram.me/jntuh

Implement various communication protocols such as TCP (Transmission


Control Protocol) and UDP (User Datagram Protocol).
Facilitate client-server communication and peer-to-peer networking.
Widely used for building networked applications and distributed systems.

2. Remote Procedure Calls (RPC)

Definition: RPC allows a process to execute procedures or functions on a remote


system as if they were local.
Characteristics:
Abstracts the communication details and provides a transparent mechanism
for interprocess communication.
Enables distributed computing by invoking functions on remote systems.
Ensures interoperability across different platforms and programming
languages.
Requires a defined interface and protocol for communication between client
and server.

www.android.previousquestionpapers.com | www.previousquestionpapers.com | https://telegram.me/jntuh

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy