Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1 views13 pages

Mt101 Dos Ppt

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1/ 13

THREADS IN

DISTRIBUTED
OPERATING SYSTEMS
ANJALI JADHAV
MT101
INTRODUCTION TO DISTRIBUTED
OPERATING SYSTEM
• Definition of (DOS):
 A distributed OS manages a collection of
independent computers (nodes) that work
together to appear as a single system to users.

• Examples:
1. Google’s Android OS
2. Microsoft’s Windows Cluster
3. Hadoop
• Threads:
 A thread is the smallest unit of execution within a
process.
 Threads allow concurrent execution within a program,
making better use of CPU resources.
THREADS: BASICS
•Definition of a Thread
•A thread is a sequence of instructions that
can be scheduled to run independently.
•A process can have multiple threads, sharing
resources like memory and I/O.

•Thread Types
•User Threads: Managed by user-level
thread libraries.
•Kernel Threads: Managed by the operating
system kernel.

•Why Threads?
•Improve resource utilization.
•Enhance responsiveness and scalability.
MULTI-THREADING
MODELS
• Many-to-One
In the many-to-one model, many user-level threads
are all mapped onto a single kernel thread. Thread
management is handled by the thread library in
user space, which is efficient in nature.

• Many-to-Many
The many-to-many model multiplexes any number
of user threads onto an equal or smaller number of
kernel threads, combining the best features of the
one-to-one and many-to-one models.

• One-to-One
Each user thread maps to one kernel thread.
provides more concurrency, if one thread makes a
blocking call another thread is allowed to run.
Creating user thread requires creating
corresponding kernel thread.
THREADS IN DISTRIBUTED SYSTEMS
• Importance of Threads in DOS:
• Distributed systems often involve multiple tasks running
on different machines, making threads essential for
managing concurrency and communication.
• Threads can be distributed across different nodes of a
system, performing parallel tasks and enhancing system
performance.

• Thread Communication in Distributed


Systems:
• Inter-Thread Communication: Threads within the same
machine can communicate via shared memory or
message passing.
• Inter-Process Communication (IPC): Threads in different
nodes of the distributed system need to communicate
THREAD MANAGEMENT IN DISTRIBUTED
OS
• Thread Scheduling
• In this threads are scheduled across different machines.
• Challenges: Load balancing, ensuring fairness, and minimizing
communication overhead.

• Thread Synchronization
• Mechanisms to ensure threads work correctly together without
conflicting.
• Challenges in distributed environments: clock synchronization,
distributed locks, and consistency protocols.

• Fault Tolerance and Recovery


• Techniques for handling thread failures or communication breakdowns,
such as checkpointing and replication.
MODELS OF THREAD EXECUTION IN
DISTRIBUTED SYSTEMS

• Centralized Thread Model:


• One central controller (e.g., a master node) manages all threads.
• Simple but can become a bottleneck.
• Decentralized Thread Model:
• Each node independently manages its own threads.
• More scalable, but more complex to synchronize.
• Hybrid Model:
• Combination of centralized and decentralized approaches.
• Balances scalability and manageability.
ADVANTAGES OF USING THREADS IN
DISTRIBUTED SYSTEMS

1. Efficiency: Threads are lightweight, which makes task


switching faster compared to full processes.
2. Concurrency: Threads allow multiple tasks to run in
parallel, improving the performance of distributed
applications.
3. Resource Sharing: Threads share the same address
space, allowing easy communication and data sharing.
4. Scalability: Thread-based systems can scale well, as new
threads can be created for handling more users or tasks.
CHALLENGES OF THREADS IN DISTRIBUTED
OPERATING SYSTEMS

• Concurrency Issues:
• Handling race conditions, deadlocks, and thread starvation.
• Fault Tolerance:
• Dealing with thread failures, node crashes, and network partitioning in
distributed systems.

• Scalability:
• Efficient management of threads when the number of nodes or threads
increases.

• Latency:
• Communication delays and synchronization overhead can affect thread
performance.
EXAMPLES

• MapReduce (Hadoop):
• Use of threads to divide data processing tasks across nodes.
• Distributed Databases:
• Threads in systems like Google Spanner or Apache Cassandra, where multi-
threading is essential for handling high concurrency and large data volumes.

• Google Spanner:
• A globally distributed database system with a multi-threaded architecture that
coordinates threads for replication, consistency, and query processing.

• Web Servers:
• Each request can be handled by a separate thread running on different
machines.
• Threads communicate to access resources like databases, caching servers, etc.
EXAMPLE: MULTI-THREADED WEB SERVER
IN DISTRIBUTED SYSTEM
• Scenario: A distributed web server handling multiple client requests.
• Thread Role: Each incoming client request is handled by a separate
thread.
• Process:
• Client sends a request to the server.
• The server creates a thread to handle the request.
• The thread processes the request, retrieves data from distributed storage, and
sends a response.

• Benefits: Fast processing and low latency due to concurrent


execution of multiple threads.
CONCLUSION

• Key Takeaways:
• Threads are essential for efficient multitasking and parallelism in
distributed systems.
• Proper thread management ensures better system performance,
scalability, and fault tolerance.

• Future Trends:
• Evolution of thread management in cloud environments, edge
computing, and microservices architecture.
Thank You…

You might also like