New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::condition_variable does not use monotonic clock #24

Closed
ongardie opened this Issue Jul 28, 2012 · 2 comments

Comments

Projects
None yet
1 participant
@ongardie
Copy link
Member

ongardie commented Jul 28, 2012

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41861
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-closed.html#887

This implies that, if the system clock is changed backwards, threads sleeping on condition variables with a timeout may not wake up for a long time.

@ongardie

This comment has been minimized.

Copy link
Member

ongardie commented Jul 28, 2012

Also, my libstdc++ 4.4 on Debian wheezy is not compiled with _GLIBCXX_USE_CLOCK_MONOTONIC, so monotonic/steady_clock is just typedefed to system_clock.

ongardie added a commit that referenced this issue Dec 14, 2014

Add warning if no steady C++11 clock available
This logs a warning now when servers start up for systems where no monotonic
clock is available, which seems to be the case up through libstdc++ 4.8.

For #24: std::condition_variable does not use monotonic clock

@ongardie ongardie closed this in 7be0672 Dec 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment