This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/16410] pthread_cond_timedwait has 70us latency when abstime already expired
- From: "triegel at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 11 Jan 2017 12:50:15 +0000
- Subject: [Bug nptl/16410] pthread_cond_timedwait has 70us latency when abstime already expired
- Auto-submitted: auto-generated
- References: <bug-16410-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16410
Torvald Riegel <triegel at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |triegel at redhat dot com
Resolution|--- |WONTFIX
--- Comment #3 from Torvald Riegel <triegel at redhat dot com> ---
I do not think that pthread_cond_timedwait is meant to be used with absolute
timeouts that have already expired. The intent is to actually wait for a
condition. If timeouts are extremely short (or expired), then the typical
usage pattern of a pthread_cond_timedwait essentially becomes busy-waiting by
constantly acquiring and releasing the associated mutex. This is not what
condition variables are intended for.
Adding the clock_gettime call as a check can reduce wake-up latency in other
scenarios (by the amount of time required to perform the clock_gettime call);
thus, the proposed change would not be a clear performance win generally.
Also, if programs have extremely short or potentially expired timeouts, they
can easily run clock_gettime themselves in the critical section before calling
pthread_cond_timedwait.
Thus, I'm closing this as WONTFIX.
--
You are receiving this mail because:
You are on the CC list for the bug.