This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug nptl/16410] pthread_cond_timedwait has 70us latency when abstime already expired


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]