delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/26/18:04:25

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: <40DDEE8F.7090707@ntlworld.com>
Date: Sat, 26 Jun 2004 22:45:51 +0100
From: Mark Thornton <mark DOT p DOT thornton AT ntlworld DOT com>
User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207)
MIME-Version: 1.0
CC: cygwin AT cygwin DOT com
Subject: Re: higher-level IO very slow with cygwin1.dll 5.10 (due to set_flags?)
References: <opr96vbqwilh6y6a AT localhost> <20040626154504 DOT GA961349 AT hpn5170x> <20040626160554 DOT GA980221 AT hpn5170x> <20040626170940 DOT GD20063 AT trixie DOT casa DOT cgf DOT cx> <20040626174145 DOT GA1032441 AT hpn5170x>
In-Reply-To: <20040626174145.GA1032441@hpn5170x>
X-IsSubscribed: yes

Pierre A. Humblet wrote:

>On Sat, Jun 26, 2004 at 01:09:40PM -0400, Christopher Faylor wrote:
>  
>
>>On Sat, Jun 26, 2004 at 12:05:54PM -0400, Pierre A. Humblet wrote:
>>    
>>
>>>Beware, I found this:
>>>2000-05-19  DJ Delorie  <dj AT cygnus DOT com>
>>>	* libc/include/stdio.h: no getc/putc macros for cygwin; causes
>>>	compatibility issues with different dll versions
>>>so you may need to recompile when updating cygwin.
>>>      
>>>
>>Also wouldn't that work around the file locks that were ostensibly put
>>there for a reason?
>>    
>>
>
>That crossed my mind. But there is no file lock in the macro, which is
>used by systems other than cygwin. How do they manage it?
>I also assume that single threaded programs don't need the lock.
>  
>
Is the lock to ensure that normal POSIX append semantics are obtained 
when two processes are writing to the same file? Normal win32 behaviour 
would tend to overwrite whatever had been written by the other process 
unless the file is only opened once and then the handle duplicated (very 
messy). So if you want append mode to work correctly (i.e. Unix style), 
then you always have to use file locks around any file write operation 
that is expected to be atomic. The locks could be avoided for non append 
mode writes and where the file has been exclusively locked anyway.

Single thread programs will need the lock just as much as multithread. 
You can only avoid it if you just a single process (with just one thread),.

Mark Thornton


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