Clocks, Ordering and Happens-Before
Separate machines have separate clocks that drift, so a timestamp cannot settle which of two events came first. What can be settled is causality: one event happened before another if a message carried information from the first to the second.
کارهایی که یادگیرنده بعد از این درس میتواند انجام دهد
- Show two events on different machines whose order no clock can decide
- Use the happens-before relation to order the events that can be ordered
- Explain what a logical clock counts and what it does not measure
۱ · بخوان
When chat messages from two friends arrive in a mixed order, you wonder which came first. You already know machines exchange messages over a network. Each machine has its own clock, and those clocks drift apart. So a timestamp cannot settle which of two events on different machines came first.
What can be settled is causality. One event happened before another if a message carried information from the first to the second, possibly through middlemen. Here A sends to B, then B sends to C, so each step caused the next.
Take a different setup where A and C never exchange messages, directly or through B. Their events have no definite order: no clock and no message chain decides it. Events like these are called concurrent, meaning unordered, not simultaneous.
A logical clock counts causal steps, not seconds. If one event caused another, the cause always has the lower count, so an event with a higher count cannot have caused one with a lower count. It never tells you what time anything happened. Passing one token round a ring links each handoff to the next, so rising counts mirror that order.
Drifting clocks cannot order distant events, but message chains define happened-before, and the rest is concurrent.
Original instructional content authored for os-taxonomy.
۲ · ببین
به انگلیسیدور از صفحهنمایش
جایگاه این موضوع
اول اینها را یاد بگیر
پیوندهای اختیاری
۸ سؤال پشت این درس منتظرند، هر کدام با پاسخ توضیحدادهشده. هر پاسخ آسمان را پر میکند: ستارهها هنگام یادگیری روشن میشوند و وقتی زمان برگشتن است کمرنگ میشوند.
شروع یادگیری این موضوع