July 2017
Intermediate to advanced
244 pages
6h 33m
English
One can indicate to the OS that the current thread can be rescheduled so that other threads can run instead. For this, one uses the std::this_thread::yield() function. The exact result of this function depends on the underlying OS implementation and its scheduler. In the case of a FIFO scheduler, it's likely that the calling thread will be put at the back of the queue.
This is a highly specialized function, with special use cases. It should not be used without first validating its effect on the application's performance.
Read now
Unlock full access