delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/06/06/21:52:20

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <42A4FDB2.4030205@tlinx.org>
Date: Mon, 06 Jun 2005 18:51:46 -0700
From: Linda W <cygwin AT tlinx DOT org>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Performance problems
References: <4297A14B DOT 9070409 AT plausible DOT org> <20050528131501 DOT V53507 AT logout DOT sh DOT cvut DOT cz> <20050528160424 DOT GB12395 AT trixie DOT casa DOT cgf DOT cx> <429ED094 DOT 9080001 AT tlinx DOT org> <Pine DOT GSO DOT 4 DOT 61 DOT 0506021301320 DOT 10282 AT slinky DOT cs DOT nyu DOT edu> <20050602172226 DOT GC6597 AT trixie DOT casa DOT cgf DOT cx> <42A2246D DOT 3090000 AT tlinx DOT org> <20050605005508 DOT GA2706 AT trixie DOT casa DOT cgf DOT cx> <42A3BC5C DOT 1090605 AT tlinx DOT org> <20050606034652 DOT GB9161 AT trixie DOT casa DOT cgf DOT cx>
In-Reply-To: <20050606034652.GB9161@trixie.casa.cgf.cx>
X-IsSubscribed: yes

><And as soon as you start timing out your cache, you either have a
>separate thread running which manages this (which implies careful
>attention to locking issues and context switching) or you a schedule
>  timer signal (which has similar problems).)
>  
>
This may not be necessary if you only cache file handles within
1 execution of a program (like find), so that file-ops within the same 
program achive speedup.  You could time-out cache entries on an
as-needed basis or timer.

>I was filling in the details here just to show that the solution of
>keeping files open has consequences.  Keeping the file open increases
>the complexity of every function which manipulates a file rather than
>the one or two functions which might be interested in the cached status
>information.
>  
>
True...but ideally we are only talking about caching & leaving
open file desriptors within 1 or 2 clockticks -- within the same
program.  If another cygwin program requests deletion of the
file, schedule it for deletion when it becomes uncached.

Sure, I'm sure you and I both can come up with infinite ways that
it might be implemented in a broken manner.  I guess I'm
operating under the assumption that it would be done correctly --
with the ability to turn it on/off via a CYGWIN var or such,
while it is being developed. 

I'd start with defaulting to off and then start adding code
which would be enabled when I set some "CACHING_TIME" or CACHING_FDS"
variables in "CYGWIN", for example.  Once I thought it worked
well and passed most of my tests, announce functionality and let
those who want to test it out, turn it on.

If it is stable, at some future point, it could default to ON but
still allow turning it off if it causes someone's apps to misbehave.

It's similar to the "synchronous" write flags on network and hard
disk shares.  If you need synchronous operation, you live with the
performance penalty of synchronous writes.  However, most people seem
to find asynchronous writes to be acceptable.

>>This is already a problem even w/o caching.  Cygwin can't delete
>>various directories because they are kept open by the login shell.
>>    
>>
>
>Being unable to consistently delete a file because something has it open
>is explainable.  What isn't explainable is "Why does my configure script
>work some times but not others?"  When you talk about keeping caching information
>around, you stand the chance of something like this not working:
>
>  find . -name foo | xargs rm
>
>because find may still have foo open when rm tries to remove it.
>  
>
---
    Parallel processes processing the same files could be tricky.
That's where inter-process knowledge of cached files would be handy --
specifically to handle deletion on close.  No one is saying
caching is simple, but done in some limited form could speed up
things considerably, with the primary purpose being to speed up
POSIX emulation within the same process.  Providing safety nets
to ensure that POSIX programs are aware of the other POSIX
programs that might be accessing the same file would guarantee
correct operation under cygwin -- but if you mix cygwin with
windows-unix and windows calls...well that can just be confusing.

    As for the OS making changes to a file outside of cygwin -- I
thought it was possible to monitor an open-file descriptor and be
notified when there were changes done on the file.  Isn't that the
basis of the automated Windows file check&repair facility?

-l


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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