delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/05/26/11:57:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 26 May 2010 11:57:10 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: 1.7.5-1: problem with settimeofday() & gettimeofday()
Message-ID: <20100526155710.GA24516@ednor.casa.cgf.cx>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <AANLkTinhHkaC_eMAcMTykCo-YLrPvzjS-8cTSeNAMIZC AT mail DOT gmail DOT com> <AANLkTimO0foA5_I7qcjnqy6M1-IlxCnTAxxT-EmMZ_v_ AT mail DOT gmail DOT com> <20100526142214 DOT GB20644 AT ednor DOT casa DOT cgf DOT cx> <20100526142543 DOT GM10652 AT calimero DOT vinschen DOT de> <20100526155620 DOT GD20644 AT ednor DOT casa DOT cgf DOT cx>
MIME-Version: 1.0
In-Reply-To: <20100526155620.GD20644@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.20 (2009-06-14)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Wed, May 26, 2010 at 11:56:20AM -0400, Christopher Faylor wrote:
>On Wed, May 26, 2010 at 04:25:43PM +0200, Corinna Vinschen wrote:
>>On May 26 10:22, Christopher Faylor wrote:
>>> On Wed, May 26, 2010 at 04:02:45PM +0300, "??? ??????" wrote:
>>> >> Hello. It seems that I found a problem with settimeofday() and
>>> >> gettimeofday() calls in a single context. The problem is that if we
>>> >> set a new time with settimeofday() call it completes succefully and
>>> >> system time is updated. But then if we try to get current time with
>>> >> gettimeofday() call it returns old time!
>>> >
>>> >I've looked into 'times.cc' and found that 'hires_ms gtod' timer
>>> >(which is used in gettimeofday()) is not reset with
>>> >'hires_ms::prime()' in settimeofday() after system call to Win32 API
>>> >SetSystemTime() function! I think this is the reason of described
>>> >behaviour.
>>> 
>>> That sounds right.  I'll check in a fix shortly.
>>
>>What happens in other, parallel processes which are calling gettimeofday
>>in a loop?
>
>I think we've always known that long-running cygwin processes did not
>deal with date/time changes correctly.  However, for cygwin processes, in
>the same session at least, I think that sharing the gtod variable should
>work.  In my limited testing it seems to.
>
>The most recent snapshot has this change as well as all of the stuff
>Corinna has done today:
>
>http://cygwin.com/snapshots/

Oh, I forgot to say: Thanks for the test case.  Those are always extremely
appreciated.

cgf

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019