TAILIEUCHUNG - Operating System Concepts (18)

Module 18: Distributed Coordination.• Event Ordering.• Mutual Exclusion.• Atomicity.• Concurrency Control.• Deadlock Handling.• Election Algorithms.• Reaching Agreement. Silberschatz and Galvin 1999 Event Ordering.• Happened-before relation (denoted by ) – If A and B are events in the same process, and A was. executed before B, then A B – If A is the event of sending a message by one process and. B is the event of receiving that message by another. process, then A B – If A B and B C then A C Silberschatz and Galvin 1999 Implementation of.• Associate a timestamp with each system event. Require that for. every pair of events A and B, if A B, then the timestamp of A is. less than the timestamp of B• Within each process Pi a logical clock, LCi is associated. The. logical clock can be implemented as a simple counter that is. incremented between any two successive events executed within. a process• A process advances its logical clock when it receives a message. whose timestamp is greater than the current value of its logical. clock• If the timestamps of two events A and B are the same, then the. events are concurrent. We may use the process identity. numbers to break ties and to create a total ordering. Silberschatz and Galvin 1999 Distributed Mutual Exclusion (DME).• Assumptions. – The system consists of n processes; each process Pi. resides at a different processor – Each process has a critical section that requires mutual. exclusion• Requirement. – If Pi is executing in its critical section, then no other process. Pj is executing in its critical section.• We present two algorithms to ensure the mutual exclusion. execution of processes in their critical sections Silberschatz and Galvin 1999 DME: Centralized Approach.• One of the processes in the system is chosen to coordinate the. entry to the critical section• A process that wants to enter its critical section sends a request. message to the coordinator• The coordinator decides which process can enter the critical. section next, and its sends that process a reply message• When the process receives a reply message from the. coordinator, it enters its critical section• After exiting its critical section, the process sends a release. message to the coordinator and proceeds with its execution• This scheme requires three messages per critical-section entry:. – request. – reply. – release. Silberschatz and Galvin 1999 DME: Fully Distributed Approach.• When process Pi wants to enter its critical section, it generates a. new timestamp, TS, and sends the message request (Pi, TS) to. all other processes in the system• When process Pj receives a request message, it may reply. immediately or it may defer sending a reply back• When process Pi receives a reply message from all other. processes in the system, it can enter its critical section• After exiting its critical section, the process sends reply. messages to all its deferred requests Silberschatz and Galvin 1999 DME: Fully Distributed Approach (Cont.).• The decision whether process Pj replies immediately to a. request(Pi, TS) message or defers its reply is based on three. factors:. – If Pj is in its critical section, then it defers its reply to Pi – If Pj does not want to enter its critical section, then it sends a. reply immediately to Pi

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.