<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: rigtorp</title><link>https://news.ycombinator.com/user?id=rigtorp</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sat, 11 Jul 2026 22:06:58 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=rigtorp" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by rigtorp in "Girls just wanna have fast MPMC queues with bounded waiting"]]></title><description><![CDATA[
<p>You would use one of those approaches:<p>If you align and pad each slot there won't be any false sharing and the stream prefetcher can kick in if there's only one producer or consumer.<p>If you use bijective hashing you reduce false sharing without aligning and padding. This can save memory at the expense of the stream prefetcher never kicking in.</p>
]]></description><pubDate>Thu, 09 Jul 2026 23:44:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=48853974</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=48853974</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48853974</guid></item><item><title><![CDATA[New comment by rigtorp in "Girls just wanna have fast MPMC queues with bounded waiting"]]></title><description><![CDATA[
<p>Here's my widely used implementation of this approach in C++: <a href="https://github.com/rigtorp/MPMCQueue" rel="nofollow">https://github.com/rigtorp/MPMCQueue</a></p>
]]></description><pubDate>Thu, 09 Jul 2026 20:24:43 +0000</pubDate><link>https://news.ycombinator.com/item?id=48851896</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=48851896</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48851896</guid></item><item><title><![CDATA[New comment by rigtorp in "Girls just wanna have fast MPMC queues with bounded waiting"]]></title><description><![CDATA[
<p>That looks like a rewrite of my earlier work: <a href="https://rigtorp.se/ringbuffer/" rel="nofollow">https://rigtorp.se/ringbuffer/</a></p>
]]></description><pubDate>Thu, 09 Jul 2026 20:22:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=48851869</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=48851869</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48851869</guid></item><item><title><![CDATA[New comment by rigtorp in "Incremental Backups of Gmail Takeouts"]]></title><description><![CDATA[
<p>Better to use the Gmail API to incrementally backup your mail: <a href="https://github.com/rigtorp/gmbackup" rel="nofollow">https://github.com/rigtorp/gmbackup</a></p>
]]></description><pubDate>Tue, 30 Dec 2025 22:05:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=46438587</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=46438587</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46438587</guid></item><item><title><![CDATA[New comment by rigtorp in "Incremental Backups of Gmail Takeouts"]]></title><description><![CDATA[
<p>I have a tool that saves each mail as a single file using the Gmail API: <a href="https://github.com/rigtorp/gmbackup" rel="nofollow">https://github.com/rigtorp/gmbackup</a></p>
]]></description><pubDate>Tue, 30 Dec 2025 22:03:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=46438563</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=46438563</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=46438563</guid></item><item><title><![CDATA[New comment by rigtorp in "Fast Fourier Transforms Part 1: Cooley-Tukey"]]></title><description><![CDATA[
<p>Interesting, of course many computations can be expressed as a graph. In the case of the bipartite graph we perform belief propagation on to decode LDPC where is the optimization from the distributive property? The parity matrix would typically be constructed so that there's few subexpression to factor out, to maximize the error correcting properties.<p>I agree both FFT and belief propagation can be expressed as message passing algorithms.</p>
]]></description><pubDate>Thu, 18 Sep 2025 19:07:41 +0000</pubDate><link>https://news.ycombinator.com/item?id=45293691</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=45293691</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45293691</guid></item><item><title><![CDATA[New comment by rigtorp in "Fast Fourier Transforms Part 1: Cooley-Tukey"]]></title><description><![CDATA[
<p>How is belief propagation used for decoding LDPC codes related to FFT?</p>
]]></description><pubDate>Thu, 18 Sep 2025 15:29:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=45290871</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=45290871</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45290871</guid></item><item><title><![CDATA[New comment by rigtorp in "Optimizing a ring buffer for throughput (2021)"]]></title><description><![CDATA[
<p>I think it will be invalidated due to RFO when the reader reads the write index. Only when multiple readers reads the same cache line without any intervening write will the RFO heuristic be disabled.</p>
]]></description><pubDate>Tue, 27 Jun 2023 12:59:04 +0000</pubDate><link>https://news.ycombinator.com/item?id=36492105</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=36492105</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36492105</guid></item><item><title><![CDATA[New comment by rigtorp in "Optimizing a ring buffer for throughput (2021)"]]></title><description><![CDATA[
<p>It might also be better for performance since the two cores can RFO the buffer pointer cache lines from each other.</p>
]]></description><pubDate>Tue, 27 Jun 2023 10:49:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=36491206</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=36491206</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36491206</guid></item><item><title><![CDATA[New comment by rigtorp in "Optimizing a ring buffer for throughput (2021)"]]></title><description><![CDATA[
<p>There might be an additional optimization in having the writer also cache it's write index on the cache line together with the read index cache. This way the writer would only do writes to the write index cache line. The hardware might be able to optimize this. I wonder how it interacts with UMWAIT on the latest cores.</p>
]]></description><pubDate>Tue, 27 Jun 2023 10:46:45 +0000</pubDate><link>https://news.ycombinator.com/item?id=36491178</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=36491178</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=36491178</guid></item><item><title><![CDATA[New comment by rigtorp in "Measuring CPU core-to-core latency"]]></title><description><![CDATA[
<p>I have something similar but in C++: <a href="https://github.com/rigtorp/c2clat" rel="nofollow">https://github.com/rigtorp/c2clat</a></p>
]]></description><pubDate>Sun, 18 Sep 2022 20:14:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=32891070</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=32891070</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=32891070</guid></item><item><title><![CDATA[New comment by rigtorp in "Twenty years of Valgrind"]]></title><description><![CDATA[
<p>You might need to add -fno-omit-frame-pointer to help ASAN unwind the stack.</p>
]]></description><pubDate>Wed, 27 Jul 2022 00:02:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=32245537</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=32245537</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=32245537</guid></item><item><title><![CDATA[New comment by rigtorp in "Shenandoah in OpenJDK 17: Sub-millisecond GC pauses"]]></title><description><![CDATA[
<p>You're incorrect, garbage collection would be the biggest problem for that use case. You have to be really careful even with your C/C++ code, warming up the branch predictor between packets etc, see my article for some pitfalls: <a href="https://rigtorp.se/virtual-memory/" rel="nofollow">https://rigtorp.se/virtual-memory/</a></p>
]]></description><pubDate>Fri, 17 Sep 2021 12:47:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=28564816</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=28564816</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28564816</guid></item><item><title><![CDATA[New comment by rigtorp in "Programming Language Memory Models"]]></title><description><![CDATA[
<p>The standard says that a thread must eventually terminate, do an atomic operation or do IO. So the while(lock.exchange(true)); loop is different.<p>Also keep in mind that C++11 specifies std::mutex::lock() to have acquire semantics and unlock() to have release semantics on the lock object. In order for std::mutex to actually work the reordering of m1.unlock(); m2.lock(); to m2.lock(); m1.unlock(); must be disallowed. But since m1 and m2 are separate objects m1.unlock() has no happens before relationship with m2.lock(). This seems to be a problem in the C++11 memory model. The arguments I have heard from some WG21 people is that there is no problem since transforming a wellformed terminating program into a non-terminating program is not allowed. I can't find the wording in the C++ standard that asserts this. But oh well, it works right now on gcc/llvm/msvc.</p>
]]></description><pubDate>Wed, 07 Jul 2021 12:23:08 +0000</pubDate><link>https://news.ycombinator.com/item?id=27760269</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27760269</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27760269</guid></item><item><title><![CDATA[New comment by rigtorp in "Programming Language Memory Models"]]></title><description><![CDATA[
<p>There's even more discussion on the lock memory ordering on Stackoverflow: <a href="https://stackoverflow.com/questions/61299704/how-c-standard-prevents-deadlock-in-spinlock-mutex-with-memory-order-acquire-a/61300584?noredirect=1#comment120507852_61300584" rel="nofollow">https://stackoverflow.com/questions/61299704/how-c-standard-...</a><p>Taking a lock only needs to be an acquire operation and a compiler barrier for other lock operations. Using seq_cst or acq_rel semantics is stronger than needed. From my reading and discussions with people from WG21 the current argument for why taking a lock only requires acq semantics is that a compiler optimization that transforms a non-deadlocking program into a potentially deadlocking program is not allowed. There's an interesting twitter thread where we discuss this I can't find anymore :(.</p>
]]></description><pubDate>Wed, 07 Jul 2021 10:48:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=27759541</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27759541</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27759541</guid></item><item><title><![CDATA[New comment by rigtorp in "Correctly implementing a spinlock in Modern C++"]]></title><description><![CDATA[
<p>Yes that's right!</p>
]]></description><pubDate>Tue, 29 Jun 2021 19:49:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=27680855</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27680855</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27680855</guid></item><item><title><![CDATA[New comment by rigtorp in "Correctly implementing a spinlock in Modern C++"]]></title><description><![CDATA[
<p>Well isn't that just a normal lock/mutex of the "lightweight" type (only enter kernel on contention)?<p>You cannot use that in non-preemptible context.</p>
]]></description><pubDate>Tue, 29 Jun 2021 19:19:07 +0000</pubDate><link>https://news.ycombinator.com/item?id=27680473</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27680473</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27680473</guid></item><item><title><![CDATA[New comment by rigtorp in "Correctly implementing a spinlock in Modern C++"]]></title><description><![CDATA[
<p>Deploy to production :).<p>You can use a model checker that understands C++11 memory model.</p>
]]></description><pubDate>Tue, 29 Jun 2021 19:11:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=27680379</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27680379</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27680379</guid></item><item><title><![CDATA[New comment by rigtorp in "Correctly implementing a spinlock in Modern C++"]]></title><description><![CDATA[
<p>His rant only applies to preemptible threads. If you don't have preemptible threads spinlocks works great. The linux kernel uses them in non-preemptible contexts.</p>
]]></description><pubDate>Tue, 29 Jun 2021 19:09:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=27680355</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27680355</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27680355</guid></item><item><title><![CDATA[New comment by rigtorp in "Correctly implementing a spinlock in Modern C++"]]></title><description><![CDATA[
<p>It's nonsense to do this when you can be preempted. But you can run one thread per core and avoid preemption. You can tune the linux kernel to avoid almost all preemption, due to TLB shootdowns etc: <a href="https://rigtorp.se/low-latency-guide/" rel="nofollow">https://rigtorp.se/low-latency-guide/</a></p>
]]></description><pubDate>Tue, 29 Jun 2021 19:03:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=27680275</link><dc:creator>rigtorp</dc:creator><comments>https://news.ycombinator.com/item?id=27680275</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27680275</guid></item></channel></rss>