Skip to content
LUDA · 學思辨行

LUDA · 學思辨行

Learn extensively, Understand deeply, Discern clearly, and Act resolutely.

  • About
  • Learning Path

Category: Synchronization

How Peterson’s algorithm locks two threads

November 13, 2026By HoHo Zhao

Short answer: Peterson’s algorithm gives two threads mutual exclusion with three shared variables: a flag for each thread and a single turn. A thread raises its flag, gives the turn to the other thread, and waits while the other flag is up and the turn still belongs to the…

Algorithms, SynchronizationLeave a comment

How Lamport’s bakery algorithm takes a ticket

November 13, 2026By HoHo Zhao

Short answer: Lamport’s bakery algorithm is an n-thread mutual-exclusion lock built from atomic reads and writes. A thread takes a ticket numbered one more than any ticket it can see, and it waits until every thread that holds a smaller ticket, or an equal ticket and a smaller id,…

Algorithms, SynchronizationLeave a comment
  • Algorithms
  • Arithmetic
  • Authelia
  • Clustering
  • Coding
  • Compression
  • Cryptography
  • CSS
  • Distributed Systems
  • Docker
  • Dynamic Programming
  • Exact Algorithms
  • Games
  • Geometry
  • Grafana
  • Graphs
  • Greedy
  • Heaps
  • Homelab
  • IPsec
  • LDAP
  • Linear Algebra
  • Logging
  • Loki
  • nginx
  • Number Theory
  • Numerical
  • Optimization
  • Parsing
  • Prometheus
  • Randomization
  • Range Queries
  • Sampling
  • Scheduling
  • Search
  • Searching
  • Sequences
  • Sketches
  • Sorting
  • Streams
  • Strings
  • SVG
  • Synchronization
  • Systems
  • Transforms
  • Trees

Docker EAP-MSCHAPv2 FreeRADIUS Grafana gzip IKEv2 IPsec LogQL Loki OpenLDAP Promtail StrongSwan

© 2026 LUDA · 學思辨行. Powered by WordPress.