Ds Part B
Ds Part B
2. Asynchronous Execution
Definition:
In asynchronous execution, the caller sends a request and continues its
execution without waiting for a response. The communication is non-
blocking.
Characteristics:
Sender does not wait for the receiver.
Receiver can process the request at a later time.
More complex to design and handle responses or errors.
Example in Distributed Systems:
Message queues or event-driven systems (e.g., RabbitMQ, Kafka) where
messages are processed independently of the sender’s workflow.
Advantages:
Better resource utilization and performance.
More resilient to delays and partial failures.
Disadvantages:
Harder to implement and manage (requires callbacks, polling, or
notification mechanisms).
Debugging and error handling can be more complex.
Comparison Table
Feature Synchronous Asynchronous
Blocking Yes No
Slower (waits for
Speed Faster (non-blocking)
response)
Complexity Simple to implement More complex logic
Efficiency Less efficient More efficient
Failure
More vulnerable More resilient
Handling
Use Case RPC, HTTP Messaging systems, Event-
Examples request/response driven apps
QUES… difference between Physical Clock and
Logical Clock:
Physical Clock Logical Clock
Shows real-world time (like a wall
Shows the order of events in a system.
clock).
Measured in hours, minutes, and
Measured by counting events.
seconds.
Used in real-time systems and
Used in distributed systems.
computers.
Needs to be accurate and Just keeps track of what happened
synchronized. first.
✅ 1. Crash Failures
💡 What It Is:
A node (computer/server) stops working or goes offline unexpectedly.
❌ Problem:
Other nodes don’t know whether it’s slow or truly dead.
They may get stuck waiting for a response.
🛠 Real Example:
In a banking app, if a server handling payment crashes during a
transaction, others can’t confirm whether to complete or cancel the
transaction.
3. Flow Control
Makes sure the sender does not send data too fast for the receiver.
Controls the speed of data transfer.
Helps avoid overloading the receiver.
📌 Example: Like talking slowly so the other person can write notes.
4. Error Control
Detects and fixes errors in data.
Adds a checksum to check for mistakes during transmission.
📌 Example: Like double-checking a message to ensure there are no
spelling mistakes.
5. Multiplexing and Demultiplexing
Multiplexing: Allows many apps to use the network at the same time.
Demultiplexing: Sends data to the correct application based on port
numbers.
📌 Example: Like a post office sorting letters based on the recipient's
address.
6. Congestion Control
Prevents network overload when too much data is sent at once.
Slows down data transfer if the network is too busy.
📌 Example: Like waiting in a traffic jam – only a few cars (data packets)
can go at a time.
❌ Limitations:
It can lead to more aborts, especially in high-conflict situations.
Transactions that are younger may frequently get aborted even for minor
conflicts with older ones.
🔹 Advantages
Lightweight and Fast: Ideal for real-time systems and scenarios with
frequent short messages.
Scalable: Supports large number of clients due to no connection overhead.
Simple: Minimal setup compared to TCP.
🔹 Disadvantages
Unreliable: No guarantee that messages will reach their destination.
No Congestion Control: May lead to packet loss during network
congestion.
Not Suitable for Sensitive Data: Not ideal where accuracy or order is
critical.
Disadvantages of DSM
❌ Slow Accessibility
Data access is slower than local memory access, due to network latency.
❌ Consistency Challenges
Maintaining memory consistency across nodes is complex and error-
prone.
❌ Inefficient Messaging
DSM may use asynchronous message passing, which isn't always optimal.
Ques… Explain how micro kernels can be used to
organize an operating system in a client-server
fashion.
Ans… A microkernel is the minimalistic core of an operating system that
provides only the essential services such as:
Low-level memory management
Inter-process communication (IPC)
Basic scheduling
In a client-server model, the OS is split into small, isolated processes where:
Client: Requests services (e.g., file access, device handling)
Server: Provides the requested services
Microkernel: Acts as a mediator using IPC
This model helps in better modularity, security, and fault isolation.
⚙️ Working of Microkernel in Client-Server OS
Step-by-Step Process
1. User App (Client) Makes a Request
A user application (e.g., text editor) needs to access a file. It acts as a
client.
2. Request Sent via IPC
The client sends an IPC message to the file system server through the
microkernel.
3. Microkernel Mediates
The microkernel receives the request and forwards it to the appropriate
server (e.g., File Server).
4. Server Processes Request
The File Server receives the message, processes it (e.g., reads the file), and
prepares the response.
5. Response Sent Back via Microkernel
The File Server sends the result back to the client using IPC, again via the
microkernel.
6. Client Receives Response
The application now has access to the data it requested.
✅ Advantages of Microkernel
1. Security & Reliability
Smaller kernel means less attack surface and fewer chances of system
crashes.
2. Modularity & Maintainability
Easy to update, debug, or replace services without affecting the whole OS.
3. Portability & Scalability
Can be easily adapted to different hardware or embedded systems.
⚠️ Disadvantages of Microkernel
1. Slower Performance
More context switches and message passing between components reduce
speed.
2. Higher Complexity
Designing and managing IPC between services is more complex.
3. More Memory Usage
Running multiple services in user space uses more RAM.