LightMySky
En anglais

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.

Commence ce sujetPas besoin de compte. La progression est enregistrée dans ce navigateur.

Ce que l'enfant saura faire ensuite

  • 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

1 · Lis

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.

A sends m1B gets m1B sends m2C gets m2
Try it together

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.

2 · Regarde

En anglais

Sans écran

Imprimer une fiche d'exercicesFormat A4, avec une page de corrigés pour les adultes. Sans écran, sans internet.

Où se situe ce sujet

Puis s'entraîner

8 questions attendent derrière cette leçon, chacune avec sa réponse expliquée. Chaque réponse nourrit le ciel : les étoiles s'allument à mesure qu'elles sont apprises, et pâlissent quand vient le moment de revenir.

Commence ce sujet