<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Spmc on Jasper</title><link>https://jasper-aa64.github.io/tags/spmc/</link><description>Recent content in Spmc on Jasper</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 04 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://jasper-aa64.github.io/tags/spmc/index.xml" rel="self" type="application/rss+xml"/><item><title>Trading System Notes #5: An SPMC Broadcast Ring in Shared Memory</title><link>https://jasper-aa64.github.io/posts/spmc-shared-memory-broadcast-ring/</link><pubDate>Sun, 04 Oct 2026 00:00:00 +0000</pubDate><guid>https://jasper-aa64.github.io/posts/spmc-shared-memory-broadcast-ring/</guid><description>Market data has one producer and several consumers, each of which must see every message, and the producer is the hot path that may not wait for anyone. The answer is a broadcast ring: every slot carries its own sequence stamp, readers keep private cursors, and the producer overwrites the oldest slot without ever reading reader state. The price moves to the readers — overruns are silent, a re-check after reading can&amp;rsquo;t catch a half-written slot unless the writer invalidates the stamp first, and readers that catch up take the line the producer writes next, so every flat-out write costs more. Moving the ring into shared memory adds three more rules: nothing inside it may be a pointer, the first lap pays a page fault every 32 messages, and a restarted reader loses everything unless it saved its cursor.</description></item></channel></rss>