4 ms·
I think you misunderstand the author's context. They are well of the various spin/pause/sleep strategies, and they have a specific one they need to apply to the
by cbsmith 4y ago
I think you misunderstand the author's context. They are well of the various spin/pause/sleep strategies, and they have a specific one they need to apply to their allocator. They're just changing what OS interface to one that better matches the desired behaviour. While they are writing the article for readers who might not be as familiar with these issues, so they're doing a lot of explaining, the actual work they did, particularly exploring the semantics of os_unfair_lock_with_options (as opposed to os_unfair_lock), would potentially be informative to authors of those libraries (though likely not useful as they'd no doubt have requirements not to use private APIs that might keep an application from being made available in Apple's App Store).
But the problem they're working on here isn't the calibration problem. It's about getting the spin/sleep/context switch semantics they want out of the OS.