Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Yaakov (Cygwin/X)
On Tue, 2011-08-02 at 17:42 +0200, Corinna Vinschen wrote: Does that mean the return value from NtQueryTimer is unreliable? In what way is it wrong? I'm not sure. When I run an STC (attached), it works as expected. In cancelable_wait(), however, it returns the negative system uptime. Is

Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Corinna Vinschen
On Aug 3 01:20, Yaakov (Cygwin/X) wrote: On Tue, 2011-08-02 at 17:42 +0200, Corinna Vinschen wrote: Does that mean the return value from NtQueryTimer is unreliable? In what way is it wrong? I'm not sure. When I run an STC (attached), it works as expected. In cancelable_wait(),

Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Yaakov (Cygwin/X)
On Wed, 2011-08-03 at 09:45 +0200, Corinna Vinschen wrote: On Aug 3 01:20, Yaakov (Cygwin/X) wrote: On Tue, 2011-08-02 at 17:42 +0200, Corinna Vinschen wrote: Does that mean the return value from NtQueryTimer is unreliable? In what way is it wrong? I'm not sure. When I run an STC

Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Corinna Vinschen
On Aug 3 04:19, Yaakov (Cygwin/X) wrote: On Wed, 2011-08-03 at 09:45 +0200, Corinna Vinschen wrote: On Aug 3 01:20, Yaakov (Cygwin/X) wrote: On Tue, 2011-08-02 at 17:42 +0200, Corinna Vinschen wrote: Does that mean the return value from NtQueryTimer is unreliable? In what way is it

Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Yaakov (Cygwin/X)
On Wed, 2011-08-03 at 11:27 +0200, Corinna Vinschen wrote: On Aug 3 04:19, Yaakov (Cygwin/X) wrote: Never mind, I figured it out. The difference is the timeout to WaitFor*Object*(); my STC doesn't allow the timer to finish, but cancelable_wait() does with the INFINITE timeout. If there

Re: [PATCH] clock_nanosleep(2)

2011-08-03 Thread Corinna Vinschen
On Aug 3 04:35, Yaakov (Cygwin/X) wrote: On Wed, 2011-08-03 at 11:27 +0200, Corinna Vinschen wrote: On Aug 3 04:19, Yaakov (Cygwin/X) wrote: Never mind, I figured it out. The difference is the timeout to WaitFor*Object*(); my STC doesn't allow the timer to finish, but

[PATCH] clock_nanosleep(2), round two

2011-08-03 Thread Yaakov (Cygwin/X)
Here's my second attempt at clock_nanosleep(2). After what we dealt with in round one, this should be a piece of cake. http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html http://www.kernel.org/doc/man-pages/online/pages/man2/clock_nanosleep.2.html Patches for

Re: [PATCH] clock_nanosleep(2), round two

2011-08-03 Thread Corinna Vinschen
On Aug 3 13:42, Yaakov (Cygwin/X) wrote: * cygwin.din (clock_nanosleep): Export. * posix.sgml (std-notimpl): Move clock_nanosleep from here... (std-susv4): ... to here. (std-notes): Note limitations of clock_nanosleep. * signal.cc (clock_nanosleep): Renamed from

Re: [PATCH] clock_nanosleep(2)

2011-08-02 Thread Corinna Vinschen
On Aug 1 23:09, Yaakov (Cygwin/X) wrote: On Sun, 2011-07-31 at 10:24 +0200, Corinna Vinschen wrote: anything new from the clock_nanosleep frontier? Sorry, I've been having elusive problems with CVS HEAD that have been making it hard to test my patch. Here's what I have so far, FWIW. So

Re: [PATCH] clock_nanosleep(2)

2011-08-01 Thread Yaakov (Cygwin/X)
On Sun, 2011-07-31 at 10:24 +0200, Corinna Vinschen wrote: anything new from the clock_nanosleep frontier? Sorry, I've been having elusive problems with CVS HEAD that have been making it hard to test my patch. Here's what I have so far, FWIW. So far I've found two problems with it: the

Re: [PATCH] clock_nanosleep(2)

2011-07-31 Thread Corinna Vinschen
Hi Yaakov, anything new from the clock_nanosleep frontier? On Jul 21 13:51, Yaakov (Cygwin/X) wrote: On Thu, 2011-07-21 at 12:37 +0200, Corinna Vinschen wrote: Given our current discussion to change cancelable_wait, does it make sense to review this patch? No, the cancelable_wait

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Corinna Vinschen
On Jul 20 17:03, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 16:11 +0200, Corinna Vinschen wrote: (*) Does it also influence pthread_cond_timedwait? This information seems to be missing in SUSv4. The last paragraph of RATIONALE - Timed Wait Semantics states: For cases when the

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Corinna Vinschen
On Jul 20 21:22, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 17:03 -0500, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 16:11 +0200, Corinna Vinschen wrote: The only problem I see is the fact that a call to clock_settime influences calls to clock_nanosleep with absolute timeouts(*).

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Corinna Vinschen
On Jul 21 11:21, Corinna Vinschen wrote: On Jul 20 21:22, Yaakov (Cygwin/X) wrote: Looking at the other uses of cancelable_wait(), would the following make sense: * change the timeout argument to struct timespec *; * cancelable_wait (object, INFINITE) calls change to (object, NULL);

Re: [PATCH] clock_nanosleep(2)

2011-07-21 Thread Corinna Vinschen
On Jul 19 20:54, Yaakov (Cygwin/X) wrote: This patchset implements the POSIX clock_nanosleep(2) function: http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html http://www.kernel.org/doc/man-pages/online/pages/man2/clock_nanosleep.2.html In summary,

Re: [PATCH] clock_nanosleep(2)

2011-07-21 Thread Yaakov (Cygwin/X)
On Thu, 2011-07-21 at 12:37 +0200, Corinna Vinschen wrote: Given our current discussion to change cancelable_wait, does it make sense to review this patch? No, the cancelable_wait changes need to go first. AFAICs the clock_nanosleep function will have to be changes quite a bit, right?

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Yaakov (Cygwin/X)
On Thu, 2011-07-21 at 11:35 +0200, Corinna Vinschen wrote: On Jul 21 11:21, Corinna Vinschen wrote: No, you're not at all off-base. Personally I'd prefer to use the native NT timer functions, but that's not important. No problem, that's something I keep forgetting about. What I'm missing

Re: [PATCH] clock_nanosleep(2)

2011-07-21 Thread Corinna Vinschen
On Jul 21 13:51, Yaakov (Cygwin/X) wrote: On Thu, 2011-07-21 at 12:37 +0200, Corinna Vinschen wrote: Something else occured to me, but I think we should do this in an extra step, if at all. IMO the family of sleep functions should be moved out of signal.cc into times.cc. It just seems to

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Corinna Vinschen
On Jul 21 13:59, Yaakov (Cygwin/X) wrote: On Thu, 2011-07-21 at 11:35 +0200, Corinna Vinschen wrote: On Jul 21 11:21, Corinna Vinschen wrote: No, you're not at all off-base. Personally I'd prefer to use the native NT timer functions, but that's not important. No problem, that's

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-21 Thread Corinna Vinschen
On Jul 21 21:09, Corinna Vinschen wrote: On Jul 21 13:59, Yaakov (Cygwin/X) wrote: On Thu, 2011-07-21 at 11:35 +0200, Corinna Vinschen wrote: On Jul 21 11:21, Corinna Vinschen wrote: No, you're not at all off-base. Personally I'd prefer to use the native NT timer functions, but

Re: [PATCH] clock_nanosleep(2)

2011-07-20 Thread Corinna Vinschen
Hi Yaakov, On Jul 19 20:54, Yaakov (Cygwin/X) wrote: This patchset implements the POSIX clock_nanosleep(2) function: http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html http://www.kernel.org/doc/man-pages/online/pages/man2/clock_nanosleep.2.html In summary,

Re: [PATCH] clock_nanosleep(2)

2011-07-20 Thread Yaakov (Cygwin/X)
On Wed, 2011-07-20 at 09:56 +0200, Corinna Vinschen wrote: This doesn't look right. In contrast to nanosleep, clock_nanosleep is not subsumed under the _POSIX_TIMERS option. In fact it's the only function under the _POSIX_CLOCK_SELECTION option. I did some searching, and there are actually

Re: [PATCH] clock_nanosleep(2)

2011-07-20 Thread Yaakov (Cygwin/X)
On Wed, 2011-07-20 at 04:16 -0500, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 09:56 +0200, Corinna Vinschen wrote: This doesn't look right. In contrast to nanosleep, clock_nanosleep is not subsumed under the _POSIX_TIMERS option. In fact it's the only function under the

Re: [PATCH] clock_nanosleep(2)

2011-07-20 Thread Corinna Vinschen
On Jul 20 04:50, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 04:16 -0500, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 09:56 +0200, Corinna Vinschen wrote: This doesn't look right. In contrast to nanosleep, clock_nanosleep is not subsumed under the _POSIX_TIMERS option. In fact

Re: [PATCH] clock_nanosleep(2)

2011-07-20 Thread Christopher Faylor
On Wed, Jul 20, 2011 at 09:56:54AM +0200, Corinna Vinschen wrote: I haven't much time right now. If cgf doesn't beat me to it, I'll review the function later. I have a couple of PriA problems to look into at work so I don't have much time either. cgf

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-20 Thread Yaakov (Cygwin/X)
On Wed, 2011-07-20 at 16:11 +0200, Corinna Vinschen wrote: On Jul 20 04:50, Yaakov (Cygwin/X) wrote: Actually, no need to panic, I took a closer look at this, and it's not all that hard at all, so I'll go ahead and implement pthread_condattr_[gs]etclock() as well. Just give me a day or two

Re: [PATCH] clock_nanosleep(2), pthread_condattr_[gs]etclock(3)

2011-07-20 Thread Yaakov (Cygwin/X)
On Wed, 2011-07-20 at 17:03 -0500, Yaakov (Cygwin/X) wrote: On Wed, 2011-07-20 at 16:11 +0200, Corinna Vinschen wrote: The only problem I see is the fact that a call to clock_settime influences calls to clock_nanosleep with absolute timeouts(*). However, clock_settime() can set only

[PATCH] clock_nanosleep(2)

2011-07-19 Thread Yaakov (Cygwin/X)
This patchset implements the POSIX clock_nanosleep(2) function: http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock_nanosleep.html http://www.kernel.org/doc/man-pages/online/pages/man2/clock_nanosleep.2.html In summary, clock_nanosleep(2) replaces nanosleep(2) as the primary sleeping