APOS Assignment 2 Updated
APOS Assignment 2 Updated
The 'Process Selection Policy' in a load distributing algorithm determines which task should be transferred when the need arises. This policy assesses the currently available tasks based on certain criteria, such as computational demand or data locality. It ensures that the system performs optimally by selecting tasks that best fit the current state of system resources or load distribution goals, such as minimizing response time and maximizing throughput. Effective process selection is critical to maintaining balance and efficiency within a distributed system's workflows.
A Distributed File System (DFS) ensures data consistency across replicas through replication protocols that synchronize updates among copies held on different nodes. Strategies like quorum-based approaches require a majority agreement before updates are executed, ensuring consistency while balancing load across systems. Providing transparency relies on keeping the replication process hidden from users, presenting a single unified file view. However, implementing such methods must address the trade-off between availability, performance, and consistency, as perfect synchronization can impact performance if not managed efficiently. The DFS aims to minimize this impact while maintaining the illusion of a single coherent data service.
In Suzuki-Kasami's Broadcast Algorithm, when multiple sites, such as S3 and S4, simultaneously request the token, each site broadcasts its request to all other sites. Each site maintains a data structure that includes a sequence number for each site and a token queue. If a site holds the token when receiving these requests, it updates the sequence numbers for S3 and S4 in the token and enqueues them if they are not already present in the token request queue. If another site receives a request while it holds the token, it grants the token to the site with the highest sequence number in its request queue, ensuring fair access.
Implementing a receiver-initiated load distribution algorithm in a dynamic network environment allows sites with less load to solicit tasks, adapting to real-time network conditions. This helps balance loads quickly as idle nodes request work, enhancing efficiency and reducing response time. Receiver-initiated systems enable more flexible resource use, potentially responding to network stress more agilely than sender-initiated approaches. However, they require timely status information to function efficiently and may introduce overhead if nodes frequently poll or initiate requests without sufficient computation task availability. Therefore, optimizing the polling strategy is crucial to maintain performance without excessive communication overhead.
Lamport's algorithm ensures the sequential execution of critical sections by using logical timestamps and a request queue. When a site wants to enter a critical section, it sends a request, timestamped with its logical clock, to all other sites and places this request into a local request queue. Sites acknowledge receiving the request and update their logical clocks. A site enters its critical section only if its request has the earliest timestamp in its request queue and it has received replies from all other sites that haven't made earlier requests. This prevents simultaneous execution, as all sites agree on the order of requests based on timestamps, ensuring sequential execution.
The Ricart-Agrawala algorithm has a message complexity of 2(n-1) per critical section entry, as each site must receive a reply from every other site before entering the critical section. In contrast, Lamport's algorithm requires 3(n-1) messages per entry: one request, n-1 acknowledgments, and n-1 replies to proceed. Although both algorithms ensure mutual exclusion, the Ricart-Agrawala algorithm is more efficient in terms of message complexity, reducing the number of messages needed at the expense of potentially longer waiting times due to stricter conditions for entering the critical section.
Hierarchical deadlock detection mechanisms are effective for managing distributed systems with 100 sites because they balance the trade-offs between centralized and decentralized approaches. Hierarchical systems divide the network into regions where local deadlock detection can occur, reducing message overhead, while retaining the ability to aggregate and coordinate information at higher levels for global understanding. This approach improves scalability by limiting the span of direct communication, enhances fault tolerance due to regional independence, and eases complexity in managing deadlocks system-wide, making it suitable for large-scale distributed environments.
Resource deadlock occurs when processes wait indefinitely for resources held by one another, causing a standstill. Communication deadlock, on the other hand, happens in distributed systems when processes become unresponsive to each other's messages due to a cycle of waiting for messages within the network, leading to potential indefinite waiting periods without completion. The primary distinction lies in the nature of the waiting condition: while resource deadlock involves tangible resources like files or memory, communication deadlock involves the flow of messages within a network.
Token-based algorithms, such as Suzuki-Kasami or Raymond's tree-based method, ensure mutual exclusion by circulating a unique token among participants. This reduces message complexity since acquiring the token allows entry into the critical section. They provide no deadlock and inherent prevention of starvation, as opportunities are distributed fairly. Non-token-based algorithms rely on message passing for consensus on entering a critical section. While removing a single point of failure inherent in token systems, they usually have higher message complexities and require multiple communication rounds, impacting performance. Each type’s effectiveness depends on the network size and failure resilience needs.
The primary goals of implementing a Distributed File System (DFS) include providing location and replication transparency, ensuring fault tolerance, and enabling scalability. Location transparency allows users to access files without needing to know their physical storage location, while replication transparency ensures system reliability by maintaining multiple copies of files across nodes. Fault tolerance is achieved through redundancy and replication, allowing the system to withstand network issues or node failures. Scalability is essential to accommodate growing numbers of users, files, and nodes without performance degradation. Challenges in DFS implementation include maintaining data consistency across replicas, managing network communication overhead, and ensuring concurrent access control.