expression

Lock-free progress versus per-thread completion

A lock-free algorithm guarantees system-wide progress under its execution assumptions even if an individual operation repeatedly loses races. Wait-freedom gives the stronger per-operation completion guarantee in a finite number of its own steps. Neither is a latency bound in seconds. This is a finite illustrative trace, not a proof of either property. Expected stdout (not executed): 1 Common mistake: Inferring wait-freedom from one successful worker or from the absence of a Mutex.

Formal Syntax & Structure

rust syntaxrust
lock-free: system-wide progress; wait-free: each operation completes

Working Example

Example Snippetrust
fn main() {    let trace = ["worker A retries", "worker B completes", "worker A retries"];    println!("{}", trace.iter().filter(|s| s.ends_with("completes")).count());}
Rust Reference