3 ms·
futex will do lock instructions for you in kernel space. It's non optimal to just jump to kernel space every time, but it should still at least be correct.
by monocasa 4y ago
futex will do lock instructions for you in kernel space. It's non optimal to just jump to kernel space every time, but it should still at least be correct.
- jart 4y agoA system call has even more overhead than the lock prefix!
- monocasa 4y agoTrue, but arguably this article constrains itself to the kernel-user boundary, where atomic instructions could be considered out of scope considering how the Linux syscall ABI is constructed.
- jart 4y agohttps://www.reddit.com/r/C_Programming/comments/120momf/a_lockfree_single_element_generic_queue/ https://www.reddit.com/r/C_Programming/comments/120momf/a_lo...