Concurrency Freaks
concurrencyfreaks.blogspot.com · Personal blog · on HN since 2014
Concurrency Freaks covers concurrent algorithms, including wait-free and lock-free data structures, memory reclamation, transactional memory and database isolation.
What HN saysHN links it for algorithms like Left-Right and Double Instance Locking, and one commenter notes the topic is unfashionable among most HN readers.
26HN people shared it
12linked it in comments
38stories submitted
882story points
8 months agolast shared
2014people per year2026
Most-shared posts
- 1The first MPMC memory-unbounded wait-free queue with memory reclamation3 people · 4 points · first shared 2016 · discussion on HN
- 2You say read-committed, I say buggy-code, potatoe, potato, tomatoe, tomato3 people · 3 points · first shared 2020 · discussion on HN
- 3How to (not) invent concurrent algorithms3 people · 3 points · first shared 2023 · discussion on HN
- 4Why is Snapshot Isolation not enough?2 people · 135 points · first shared 2023 · 34 comments on HN
- 5OneFile: World's First Wait-Free Software Transactional Memory2 people · 5 points · first shared 2019 · discussion on HN
- 6Concurrency Is Coordination and Sharing2 people · 4 points · first shared 2025 · discussion on HN
- 7Immutable data structures are not as good as you think they are2 people · 4 points · first shared 2016 · discussion on HN
- 8Lock-Free and Wait-Free, definition and examples (2013)2 people · 1 points · first shared 2019 · discussion on HN
- 9Why is memory reclamation so important for lock-free algorithms?1 people · 165 points · first shared 2017 · 42 comments on HN
- 10Throughput vs. Latency and Lock-Free vs. Wait-Free1 people · 146 points · first shared 2016 · 31 comments on HN
- 11What is Eventual Consistency?1 people · 105 points · first shared 2017 · 14 comments on HN
- 12CX: Wait-Free Universal Construction1 people · 91 points · first shared 2019 · 24 comments on HN
- 13The Laws of Durability1 people · 59 points · first shared 2021 · discussion on HN
- 14Leaks in Persistent Memory1 people · 56 points · first shared 2019 · 6 comments on HN
- 15Linked lists with wait-free reads in C++1 people · 49 points · first shared 2014 · 1 comments on HN
What HN people wrote when they linked it
goodroot · 2023-09-30
And it does so with three links across three paragraphs.
From the QuestDB article:
> First, I found the Double Instance Locking[1] pattern at the amazing Concurrency Freaks blog[2]. This pattern is very similar to the one I described here. It also uses 2 internals structures and readers are alternating between them. It uses a read-write lock to protect the map being mutated. Given there is only a single writer then at any given time there is at least one internal map which is available for reading. This gives readers lock freedom.
> It's fair to say that the Double Instance Locking pattern is simpler to reason about. It decomposes the problem better. But I'd still argue my contribution is the trick with delayed replay of the last operation - if writers are sufficiently rare, then writers won't be blocked at all.
> The same blog also links to the paper Left-Right: A Concurrency Control Technique with Wait-Free Population Oblivious Reads[3] which on the surface also looks similar. It claims not only Lock-Freedom, but also Wait-Freedom. I have yet to deep dive into it.
[1] http://concurrencyfreaks.blogspot.com/2013/11/double-instance-locking.…
[2] http://concurrencyfreaks.blogspot.com/
[3] https://master.dl.sourceforge.net/project/ccfreaks/papers/LeftRight/le…
RcouF1uZ4gsC · 2022-05-23
A very nice approach for read heavy structures is the Left-Right algorithm.
http://concurrencyfreaks.blogspot.com/2013/12/left-right-classical-alg…
It does cost an extra instance, but it generalizes to any data structure and gives you wait-free reads.
RyanZAG · 2014-01-08
Very much unfashionable for the HN crowd. Most of the new research in concurrency is happening in Java and funded by the high performance trading industry - an industry which is very far from the HN crowd. The new Java8 stampedlock is a good example. It's possible to implement it in C++ as well, but because of the guarantees required by the lock it is a very difficult lock to integrate into C++ code. On the other hand, the JRE guarantees the correct constraints for Java code making a stampedlock very easy to use [1]. The performance of a stampedlock also seems to be the best case for any multi-reader environment. [2]
[1] http://concurrencyfreaks.blogspot.com/2013/11/stampedlocktryoptimistic…
[2] http://mechanical-sympathy.blogspot.ca/2013/08/lock-based-vs-lock-free…
AzN1337c0d3r · 2026-02-24
Left-right concurrency control might be a good fit for this problem.
https://concurrencyfreaks.blogspot.com/2013/12/left-right-concurrency-…
MaxBarraclough · 2020-05-05
> You may have lock-free code with locks
That doesn't sound right. I suppose you could have locks in the trivial sense, where it never actually blocks, but I don't imagine that's what you meant.
https://concurrencyfreaks.blogspot.com/2013/05/lock-free-and-wait-free…
https://www.cs.yale.edu/homes/aspnes/pinewiki/ObstructionFreedom.html
pjmlp · 2020-02-22
Here is an overview, read also the comments.
https://concurrencyfreaks.blogspot.com/2017/08/why-is-memory-reclamati…
dmoldavanov · 2019-11-07
They also have _comparison_ with RCU
https://concurrencyfreaks.blogspot.com/2019/10/is-rcu-generic-concurre…
qznc · 2017-09-17
You may find this interesting: https://concurrencyfreaks.blogspot.de/2017/08/why-is-memory-reclamatio…
maykr · 2017-03-17
This post directly compliments the original one
http://concurrencyfreaks.blogspot.com/2017/02/bitnext-lock-free-queue.…
pmontra · 2017-02-20
That's what languages with immutable data structures do. Internally they implement simple data structures (lists, arrays) with more complex ones not to get a performance hit. For example, they don't want to copy every byte every time they add or remove from a list.
In ascending order of complexity
http://theerlangelist.blogspot.com/2013/05/working-with-immutable-data…
http://concurrencyfreaks.blogspot.com/2013/10/immutable-data-structure…
http://debasishg.blogspot.com/2010/05/grokking-functional-data-structu…
In the case of Ruby, it's a language build on mutability so let's use mutable data. There are already plenty of languages with immutable data to use if we want to.
hellofunk · 2016-03-31
Here is a related article for anyone curious about, or who uses, persistent/immutable data structures:
http://concurrencyfreaks.blogspot.nl/2013/10/immutable-data-structures…
Gwypaas · 2022-08-04
Don't really have an axe to grind regarding strict-serializability, serializability, snapshot isolation or whatever. Start at the highest level of consistency and consciously step away if you encounter issues.
The Postgres default of "Read committed" gives me shivers on the other hand...
> If I were to make a concurrent map data structure whose operations are not linearizable and then put it on a library and give it to my users, any user of that library would come back to me and say that my library has a bug. They may not be able to tell me exactly what it is, but they'll understand that there is a bug in it.
> However, if I take the same concurrent map data structure, and put in an application and call that application a "Key-Value store" or a "Database" (DBMS) and give it to the typical database users, it seems they may certainly use it for a several decades without ever complaining that this "Database" is not linearizable (or serializable as the DB folks call it).
https://concurrencyfreaks.blogspot.com/2020/06/you-say-read-committed-…