<- Back
Comments (34)
- GlenTheMachineIf you had no idea what a restorable sequence is the takeaway is about halfway down the OP:“This is why Linux now provides rseq() which is a much more enlightened solution. With restartable sequences, you actually can get rid of both the mutex and atomics, while the OS continues to fully abstract scheduling. The way it works is you advise the kernel whenever your program enters a critical section of code that you don't want interrupted. It's probably going to be maybe 10 assembly instructions tops. The first assembly opcode should be a move instruction that sets the rseq_cs field. The last instruction needs to be the thing that makes the modification to your global data structure. Think of it sort of like a really tiny database transaction. What makes it go fast, is that the bidirectional communication with the kernel happens via shared memory.”
- senderistaI'm surprised there was no reference to the librseq library, maintained by the rseq implementer:https://github.com/compudj/librseqThis has helpers for common use cases like counters and linked lists. You shouldn't need to write assembly at all to use rseq in most applications.
- khueyMaybe I'm just getting old but the "if you don't spend $20,000 on a workstation you're going to be left behind like a dinosaur" at the top of this article is a huge turn off to reading any further. And I say that as someone who owns a workstation with more cores than the author's.
- dan_sblLove how the 512 GB of RAM documented in one of his setups as costing $2,776 now sells for $18,299. https://justine.lol/rseq/threadripper.html
- keyle... bidirectional communication with the kernel happens via shared memory. What could possibly go wrong?
- yubblegum> chances are the CPU's internal mutexes aren't as good as the ones you've implemented in userspaceAnyone with an informed opinion on this statement? It's seems counter intuitive (npi).
- Veserv[flagged]