Low-Latency Trading Systems in Rust

In high-frequency trading (HFT), microseconds determine profitability. When an arbitrage opportunity appears—say, a 0.01% price discrepancy between two exchanges—it vanishes within 100-500 microseconds as competing algorithms exploit it. The firm that detects and acts fastest captures the profit; everyone else loses. At this timescale, traditional software engineering practices (dynamic allocation, garbage collection, high-level abstractions) become liabilities. Systems must operate at the edge of hardware capability: cache-line optimization, lock-free algorithms, kernel bypass networking. ...

September 2, 2024 · 52 min · 10914 words · Svein Erik

The Actor Model: Concurrency Through Message Passing

Introduction As modern systems evolve toward distributed, highly parallel architectures, traditional concurrency techniques—locks, mutexes, and shared memory—quickly reveal their limitations. Deadlocks, race conditions, complex state coordination, and scaling bottlenecks become the norm rather than the exception. The Actor Model offers a radically different paradigm. Instead of sharing memory between threads, actors communicate by sending immutable messages, allowing systems to scale horizontally, avoid shared-state complexity, and model real-world workflows with surprising elegance. ...

April 17, 2022 · 34 min · 7033 words · Svein Erik