分布式系统英文教案chap-05_zy.pptVIP

  • 7
  • 0
  • 约1.39万字
  • 约 63页
  • 2018-03-06 发布于江西
  • 举报
分布式系统英文教案chap-05_zy

A Centralized Algorithm Process 1 asks the coordinator for permission to enter a critical region. Permission is granted Process 2 then asks permission to enter the same critical region. The coordinator does not reply. When process 1 exits the critical region, it tells the coordinator, when then replies to 2 A Centralized Algorithm Problems: If the coordinator is dead, the entire system may go down. If processes normally block after making a request, there is no way to distinguish a dead coordinator from “permission denied”. A possible bottleneck. A Distributed Algorithm Description When a process wants to enter a critical region, it builds a message to all others including its timestamp When a process receives a request, If it is not currently in the CR and does not want to enter it, it sends “OK” back. If it is already in CR, it queues the request If it is preparing to enter the CR, it compares the timestamp with its own, the lower one wins. It sends “OK” or queues the request. A Distributed Algorithm Description When “OK”s come from all processes, the process can enter the CR. When a process exits the CR, it sends the “OK” to all processes on its queue and deletes them all from the queue. A Distributed Algorithm Two processes want to enter the same critical region at the same moment. Process 0 has the lowest timestamp, so it wins. When process 0 is done, it sends an OK also, so 2 can now enter the critical region. A Distributed Algorithm Problems The number of messages required per entry is now 2(n-1), where n is the # of processes. The single point of failure has been replaced by n points of failure. All processes are involved in all decisions concerning entry into the CR, still bottleneck. A receiver always sends a message back, either granting or denying the permission. A process is allowed to enter a CR when it gets permission from the majority. Each process can only grant one permission at a time. A Toke Ring Algorithm Description A logical rin

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档