Thread::yield vs Thread::onSpinWait
问题 Well the title basically says it all, with the small addition that I would really like to know when to use them. And it might be simple enough - I've read the documentation for them both, still can't tell the difference much. There are answers like this here that basically say: Yielding also was useful for busy waiting... I can't agree much with them for the simple reason that ForkJoinPool uses Thread::yield internally and that is a pretty recent addition in the jdk world. The thing that