Yes, the first one will make the processor work much better than the second. In principle, whenever the active thread in the first example receives the planned value, it simply absorbs the entire processor processing time in this state until the scheduler selects it and gives a different thread time. This means that you have context switches, and the entire thread (potentially) of the flow time is used 100% each time, and it actually does not work.
The second example will delay the thread in the kernel, so it will not receive any processor time until the kernel receives a signal and resumes the thread. As soon as this happens, the scheduler will give it processing time again, but now we know that it has the actual work, and not just the use of its entire time segment, binding the processor.
source share