4 ms·
Sorry! I was looking for documentation that on Linux sleep(0) yields.
by orbisvicis 2y ago
Sorry! I was looking for documentation that on Linux sleep(0) yields.
- eqvinox 2y agoThere is no code in nanosleep that converts it into a yield, and in fact a nanosleep(0) is a nanosleep(50µs) with the default timer slack value. If you want to yield, call sched_yield() …
- orbisvicis 2y agoI looked into this a bit further and it seems to be a range from [0,50]. [1] explains that if there is a pre-existing timer interrupt at 0, then the queue will be resumed at 0. But yes - given no other timers it will resume at 50. 1. https://people.kernel.org/joelfernandes/on-workings-of-hrtimers-slack-time-functionality https://people.kernel.org/joelfernandes/on-workings-of-hrtim...