DISTRIBUTED SYSTEMS principles and paradigms Second Edition phần 5

Lợi thế thứ hai là một địa chỉ trở nên có sẵn cho tra cứu càng sớm càng tốt. Do đó, nếu một nút phụ huynh tạm thời không thể truy cập, địa chỉ vẫn có thể được xem xét trong lĩnh vực đại diện bởi các nút hiện tại. Một hoạt động xóa tương tự như một hoạt động chèn. | 266 SYNCHRONIZA nON CHAP. 6 A Ring Algorithm Another election algorithm is based on the use of a ring. Unlike some ring algorithms this one does not use a token. We assume that the processes are physically or logically ordered so that each process knows who its successor is. When any process notices that the coordinator is not functioning it builds an ELECTION message containing its own process number and sends the message to its successor. If the successor is down the sender skips over the successor and goes to the next member along the ring. or the one after that until a running process is located. At each step along the way the sender adds its own process number to the list in the message effectively making itself a candidate to be elected as coordinator. Eventually the message gets back to the process that started it all. That process recognizes this event when it receives an incoming message containing its own process number. At that point the message type is changed to COORDINATOR and circulated once again this time to inform everyone else who the coordinator is the list member with the highest number and who the members of the new ring are. When this message has circulated once it is removed and everyone goes back to work. Figure 6-21. Election algorithm using a ring. In Fig. 6-21 we see what happens if two processes 2 and 5 discover simultaneously that the previous coordinator process 7 has crashed. Each of these builds an ELECTION message and and each of them starts circulating its message independent of the other one. Eventually both messages will go all the way around and both 2 and 5 will convert them into COORDINATOR messages with exactly the same members and in the same order. When both have gone around again both will be removed. It does no harm to have extra messages circulating at worst it consumes a little bandwidth but this not considered wasteful. SEC. ELECTION ALGORITHMS 267 Elections in Wireless Environments Traditional election .

Bấm vào đây để xem trước nội dung
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.