A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../error/error_code/../../thread/yield.html below:

std::this_thread::yield - cppreference.com

void yield() noexcept;

(since C++11)

Provides a hint to the implementation to reschedule the execution of threads, allowing other threads to run.

[edit] Parameters

(none)

[edit] Return value

(none)

[edit] Notes

The exact behavior of this function depends on the implementation, in particular on the mechanics of the OS scheduler in use and the state of the system. For example, a first-in-first-out realtime scheduler (SCHED_FIFO in Linux) would suspend the current thread and put it on the back of the queue of the same-priority threads that are ready to run, and if there are no other threads at the same priority, yield has no effect.

[edit] Example

Possible output:

waited for 128 microseconds
[edit] See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4