Re: Adding a clockid_t parameter to functions that accept absolute timespecs (was Re: C++ condition_variable and timed_mutex with steady_clock and pthreads)

2018-10-29 Thread Tom Cherry
On Sat, Oct 27, 2018 at 5:16 PM Mark Harris wrote: > > On Sat, 27 Oct 2018 at 13:14, Mike Crowe wrote: >> >> On Saturday 27 October 2018 at 15:26:07 -0400, Daniel Eischen wrote: >> > >> > > On Oct 27, 2018, at 12:14 PM, Mike Crowe >> > > wrote: >> > > Looking through POSIX Base Specifications

Re: Adding a clockid_t parameter to functions that accept absolute timespecs (was Re: C++ condition_variable and timed_mutex with steady_clock and pthreads)

2018-10-27 Thread Mark Harris
On Sat, 27 Oct 2018 at 13:14, Mike Crowe wrote: > On Saturday 27 October 2018 at 15:26:07 -0400, Daniel Eischen wrote: > > > > > On Oct 27, 2018, at 12:14 PM, Mike Crowe > wrote: > > > Looking through POSIX Base Specifications Issue 7, I > > > believe that the following other functions lack a

Re: Adding a clockid_t parameter to functions that accept absolute timespecs (was Re: C++ condition_variable and timed_mutex with steady_clock and pthreads)

2018-10-27 Thread Mike Crowe
On Saturday 27 October 2018 at 17:07:00 -0400, Daniel Eischen wrote: > The nice thing about being able to set the clock in an attribute or some > other way (e.g., pthread_set_preferred_clock) is that you only have to do > it once, as opposed to potentially modifying lots of other code, even in >

Re: Adding a clockid_t parameter to functions that accept absolute timespecs (was Re: C++ condition_variable and timed_mutex with steady_clock and pthreads)

2018-10-27 Thread Daniel Eischen
> On Oct 27, 2018, at 4:13 PM, Mike Crowe wrote: > >> On Saturday 27 October 2018 at 15:26:07 -0400, Daniel Eischen wrote: >> >>> On Oct 27, 2018, at 12:14 PM, Mike Crowe >>> wrote: >>> Looking through POSIX Base Specifications Issue 7, I >>> believe that the following other functions lack

Adding a clockid_t parameter to functions that accept absolute timespecs (was Re: C++ condition_variable and timed_mutex with steady_clock and pthreads)

2018-10-27 Thread Mike Crowe
On Saturday 27 October 2018 at 15:26:07 -0400, Daniel Eischen wrote: > > > On Oct 27, 2018, at 12:14 PM, Mike Crowe > > wrote: > > Looking through POSIX Base Specifications Issue 7, I > > believe that the following other functions lack a way to use > > CLOCK_MONOTONIC directly (and unlike

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-27 Thread Daniel Eischen
> On Oct 27, 2018, at 12:14 PM, Mike Crowe wrote: > > On Tue, Oct 9, 2018 at 6:19 AM Mike Crowe wrote: >>> So, my favourite solution is to invent an equivalent of >>> pthread_cond_timedwait that accepts a clockid_t since it feels more >>> future-proof, but adding the Android

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-27 Thread Mike Crowe
On Tue, Oct 9, 2018 at 6:19 AM Mike Crowe wrote: >> So, my favourite solution is to invent an equivalent of >> pthread_cond_timedwait that accepts a clockid_t since it feels more >> future-proof, but adding the Android pthread_cond_timedwait_monotonic >> instead would solve my current problems.

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-09 Thread Tom Cherry
On Tue, Oct 9, 2018 at 6:19 AM Mike Crowe wrote: > > On Monday 08 October 2018 at 22:06:10 -0400, Daniel Eischen wrote: > > > > > On Oct 8, 2018, at 1:43 PM, enh wrote: > > > > > >> On Sat, Oct 6, 2018 at 12:09 PM Mike Crowe > > >> wrote: > > >> > > >>> On Wednesday 12 September 2018 at

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-09 Thread Mike Crowe
On Monday 08 October 2018 at 22:06:10 -0400, Daniel Eischen wrote: > > > On Oct 8, 2018, at 1:43 PM, enh wrote: > > > >> On Sat, Oct 6, 2018 at 12:09 PM Mike Crowe > >> wrote: > >> > >>> On Wednesday 12 September 2018 at 13:47:59 -0700, Tom Cherry wrote: > On Wed, Sep 12, 2018 at 11:56

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-08 Thread Daniel Eischen
> On Oct 8, 2018, at 1:43 PM, enh wrote: > >> On Sat, Oct 6, 2018 at 12:09 PM Mike Crowe >> wrote: >> >>> On Wednesday 12 September 2018 at 13:47:59 -0700, Tom Cherry wrote: On Wed, Sep 12, 2018 at 11:56 AM Mike Crowe wrote: > > We (libc team for Android) have observed

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-08 Thread enh
On Sat, Oct 6, 2018 at 12:09 PM Mike Crowe wrote: > > On Wednesday 12 September 2018 at 13:47:59 -0700, Tom Cherry wrote: > > On Wed, Sep 12, 2018 at 11:56 AM Mike Crowe > > wrote: > > > > > > On Wednesday 12 September 2018 at 11:29:26 -0700, Tom Cherry wrote: > > > > On Sun, Sep 9, 2018 at

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-08 Thread Tom Cherry
On Sun, Oct 7, 2018 at 6:09 AM Mike Crowe wrote: > On Saturday 06 October 2018 at 17:43:06 -0400, Daniel Eischen wrote: > > > > > On Oct 6, 2018, at 3:00 PM, Mike Crowe > wrote: > > > > > > Thank you for your detailed responses and patch links. I'm sorry it's > taken > > > me so long to

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-07 Thread Mike Crowe
On Saturday 06 October 2018 at 17:43:06 -0400, Daniel Eischen wrote: > > > On Oct 6, 2018, at 3:00 PM, Mike Crowe wrote: > > > > Thank you for your detailed responses and patch links. I'm sorry it's taken > > me so long to respond. I was waiting to see if there were any other > > responses. >

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-06 Thread Daniel Eischen
Sent from my iPhone > On Oct 6, 2018, at 5:43 PM, Daniel Eischen wrote: > > >> On Oct 6, 2018, at 3:00 PM, Mike Crowe wrote: >> >> Thank you for your detailed responses and patch links. I'm sorry it's taken >> me so long to respond. I was waiting to see if there were any other >>

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-10-06 Thread Mike Crowe
On Wednesday 12 September 2018 at 13:47:59 -0700, Tom Cherry wrote: > On Wed, Sep 12, 2018 at 11:56 AM Mike Crowe > wrote: > > > > On Wednesday 12 September 2018 at 11:29:26 -0700, Tom Cherry wrote: > > > On Sun, Sep 9, 2018 at 8:28 AM Mike Crowe > > > wrote: > > > > > > > > On Thursday 30

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-09-12 Thread Tom Cherry
On Wed, Sep 12, 2018 at 11:56 AM Mike Crowe wrote: > > On Wednesday 12 September 2018 at 11:29:26 -0700, Tom Cherry wrote: > > On Sun, Sep 9, 2018 at 8:28 AM Mike Crowe > > wrote: > > > > > > On Thursday 30 August 2018 at 21:10:48 +0100, Mike Crowe wrote: > > > > C++11's

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-09-12 Thread Mike Crowe
On Wednesday 12 September 2018 at 11:29:26 -0700, Tom Cherry wrote: > On Sun, Sep 9, 2018 at 8:28 AM Mike Crowe wrote: > > > > On Thursday 30 August 2018 at 21:10:48 +0100, Mike Crowe wrote: > > > C++11's std::condition_variable, std::timed_mutex and > > > std::recursive_timed_mutex support

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-09-12 Thread Tom Cherry
On Sun, Sep 9, 2018 at 8:28 AM Mike Crowe wrote: > > On Thursday 30 August 2018 at 21:10:48 +0100, Mike Crowe wrote: > > C++11's std::condition_variable, std::timed_mutex and > > std::recursive_timed_mutex support waiting with a timeout specified using > > an arbitrary clock. It's common to use

Re: C++ condition_variable and timed_mutex with steady_clock and pthreads

2018-09-09 Thread Mike Crowe
On Thursday 30 August 2018 at 21:10:48 +0100, Mike Crowe wrote: > C++11's std::condition_variable, std::timed_mutex and > std::recursive_timed_mutex support waiting with a timeout specified using > an arbitrary clock. It's common to use std::chrono::steady_clock (which > corresponds to