3 ms·
I hadn't heard about this. Cool. Two obvious questions: 1) You are supposed to check the cpu number at the start and end of your critical section, to make su
by throwaway81523 5y ago
I hadn't heard about this. Cool. Two obvious questions:
1) You are supposed to check the cpu number at the start and end of your critical section, to make sure it hasn't changed. But what if it has changed twice? There should be a "changed" flag in the struct, I'd think.
2) Does the single instruction commit not itself need a lock prefix or something similar? Futex has to do something like that unless I'm mistaken.
Actually, 3) if your cpu supports something like TSX (did Intel ever get that working right?), would you want to use that in preference to rseq?
- p_l 5y agoTSX was apparently working right in some chips, but ultimately intel appears to have abandoned it and was sending microcode updates that disable it even for chips where it worked right.
- emikulic 5y agoIIUC if the CPU changes even once, your program jumps to (is context switched into) a recovery sequence.