<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Spsc on Jasper</title><link>https://jasper-aa64.github.io/tags/spsc/</link><description>Recent content in Spsc on Jasper</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 20 Sep 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://jasper-aa64.github.io/tags/spsc/index.xml" rel="self" type="application/rss+xml"/><item><title>Trading System Notes #4: Lock-Free Queues and Micro-Batching</title><link>https://jasper-aa64.github.io/posts/lock-free-queue-logger-micro-batching/</link><pubDate>Sun, 20 Sep 2026 00:00:00 +0000</pubDate><guid>https://jasper-aa64.github.io/posts/lock-free-queue-logger-micro-batching/</guid><description>A lock-free SPSC queue works because every shared variable has exactly one writer: each side updates only its own counter and merely reads the other&amp;rsquo;s. The rest is keeping that property from being quietly undone — a shared element count both cores fight over (subtract two counters instead), a full-check that reads the other core on every call (cache the other side&amp;rsquo;s cursor, which can only be wrong in the safe direction), a mirrored mapping that removes the wrap-around seam, and a logger that pushes one character per slot (thirty slots for one log line, five as text runs). It ends with the vocabulary that keeps lock-free claims honest: SPSC is wait-free only through a fail-fast interface, finite steps are not finite time, and a bounded queue must always choose between dropping and blocking.</description></item></channel></rss>