www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/09/17/09:36:58

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
Date: Mon, 17 Sep 2001 09:38:33 -0400
From: Jason Tishler <jason AT tishler DOT net>
To: Cygwin-Developers <cygwin-developers AT sources DOT redhat DOT com>
Subject: Re: WriteFile() whacks st_atime patch
Message-ID: <20010917093833.I2272@dothill.com>
Mail-Followup-To: Cygwin-Developers <cygwin-developers AT sources DOT redhat DOT com>
Mime-Version: 1.0
In-Reply-To: <1000218262.7293.272.camel@lifelesswks>
User-Agent: Mutt/1.3.18i

On Wed, Sep 12, 2001 at 12:24:21AM +1000, Robert Collins wrote:
> On Tue, 2001-09-11 at 06:22, Corinna Vinschen wrote:
> > On Mon, Sep 10, 2001 at 03:44:31PM -0400, Jason Tishler wrote: 
> > > Given the above problems, I have very mixed feelings about this patch.
> > > Is it worth pursuing or should I dropped it?
> > 
> > Frankly, I don't know.  My first guess is to prioritize correctness
> > over speed and with your patch the functionality seems to be at 
> > least `more correct'.  Would it perhaps make sense to change
> > that to something like:
> 
> I think correctness in this case is well worth it, as it's obviously
> causing some problems out there. However, it would be good to bench the
> difference building cygwin or something, to see the impact.

I will attempt to benchmark the performance impact using both a
specialized test program (e.g., writes with and without GetFileTime and
SetFileTime calls) and a more generalized scenario such as building
Cygwin (as Rob suggested).

BTW, while fiddling around, I discovered that an overridden raw_read()
will be need too:

    int
    fhandler_disk_file::raw_read (void *ptr, size_t len)
    {
      int bytes_read = fhandler_base::raw_read(ptr, len);
      if (bytes_read > 0)
        {
          FILETIME now;
          BOOL status = GetSystemTimeAsFileTime (&now);
          if (status)
            SetFileTime (get_handle(), 0, &now, 0);
        }
      return bytes_read;
    }

It appears that Windows does not update the last access time until the
file is closed or at least not immediately (possibly due to caching?).
In contract, on Red Linux 7.1, st_atime is updated immediately upon a
read -- even if the file is still open.

Jason

- Raw text -


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