From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12202 invoked by alias); 27 Mar 2012 19:00:13 -0000 Received: (qmail 12141 invoked by uid 22791); 27 Mar 2012 19:00:10 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mailout02.t-online.de (HELO mailout02.t-online.de) (194.25.134.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Mar 2012 18:59:47 +0000 Received: from fwd21.aul.t-online.de (fwd21.aul.t-online.de ) by mailout02.t-online.de with smtp id 1SCbcP-0003We-9w; Tue, 27 Mar 2012 20:59:45 +0200 Received: from [192.168.2.108] (VmcdQ+ZCghiUGedWy2ngz7KVSe-fuzK1DclDvT9EUCrJRf5+TKBmFl7fmpUOiZ5Zda@[79.224.124.210]) by fwd21.t-online.de with esmtp id 1SCbcI-0FyD7A0; Tue, 27 Mar 2012 20:59:38 +0200 Message-ID: <4F720E19.5000809@t-online.de> Date: Tue, 27 Mar 2012 19:00:00 -0000 From: Christian Franke User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20120216 Firefox/10.0.2 SeaMonkey/2.7.2 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: clock_getres(CLOCK_REALTIME, .) may return an outdated and too high resolution References: <4F6A5D42.3030108@t-online.de> <20120322093340.GW18032@calimero.vinschen.de> <4F6B65A7.9080605@t-online.de> <20120326085159.GJ2425@calimero.vinschen.de> <4F70A0C9.5060208@t-online.de> <20120327091051.GB30721@calimero.vinschen.de> <4F72007D.6080503@t-online.de> <20120327182823.GV30721@calimero.vinschen.de> In-Reply-To: <20120327182823.GV30721@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2012-03/txt/msg00716.txt.bz2 Corinna Vinschen wrote: > On Mar 27 20:01, Christian Franke wrote: >> Corinna Vinschen wrote: >>> On Mar 26 19:00, Christian Franke wrote: >>>> Corinna Vinschen wrote: >>>>> I see your point, but what bugs me a bit is the fact that >>>>> clock_getres(CLOCK_REALTIME) and clock_setres(CLOCK_REALTIME) will >>>>> always return the same value coarsest, regardless what value has been set. >>>> If clock_setres was called and succeeded, then clock_getres(.) >>>> should return the value set before. >>>> >>>> If clock_setres was not called, the coarsest value is IMO the only >>>> value that can be guaranteed. >>>> >>>> The actual value returned by NtQueryTimerResolution is simply >>>> useless in this context: It is the minimum of all resolutions >>>> currently set by all running processes. It may change at any time. >>>> There is apparently no way the query the current setting of the >>>> current process. >>> Uh, right, I misunderstood. I reverted the change to clock_setres. >> Sorry, I probably forgot to mention that NtSetTimerResolution >> returns the same useless actual value than NtQueryTimerResolution. >> >> I would suggest: >> >> status = NtSetTimerResolution (period, TRUE,&actual); >> if (!NT_SUCCESS (status)) >> { ... return -1; } >> - minperiod = actual; >> + minperiod = period; > But that's not right. The "actual" value is not useless, but the value > the resolution has actually been set to. No, again this is the minimum of all resolutions currently set by all processes. > The OS just doesn't support > arbitrary values for the period. > Yes - but in 'actual' a smaller value than the value set for the current process may be returned. Christian -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple