@paulmckrcu please don't ask me about my thoughts as to what 'make -j' did for a brief, but not brief enough, period.
@ljs @paulmckrcu oh, I *loved* abusing `make -j`....
$ make -j 10 emacs
ALL THE LIGHTS LIGHT UP SOLID-ISH...
gawk --debug # today I learnt too... and awk user for 39 years in September.
@paulmckrcu Happened to me, too. On rereading the RSEQ (restartable sequences)* documentation I find out you can set the RSEQ critical regions dynamically. So you can use it to do a wait-free hazard pointer protect that runs about 3x faster than the lock-free version. No loop w/ conditional branch instruction.
There's a couple of other ways to do wait-free hazard pointers but would require changes to retire logic.
@paulmckrcu Oh, sorry. I forgot to mention this is used w/ an asymmetric memory barriers, so it will always appear to be atomic to the retire thread which will do a membarrier() before polling the hazard pointers.
protect() is just a load and store apart from setting and clearing rseq_cs value for the restartable sequence.
@paulmckrcu Like https://pvk.ca/Blog/2020/07/07/flatter-wait-free-hazard-pointers/ but with RSEQ restartable sequence to give you atomic w.r.t. interrupts memory to memory copy. No special hardware instructions. Just Linux and membarrier.