From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12786 invoked by alias); 3 Sep 2002 12:42:55 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 12779 invoked from network); 3 Sep 2002 12:42:53 -0000 Received: from unknown (HELO cygbert.vinschen.de) (217.81.212.55) by sources.redhat.com with SMTP; 3 Sep 2002 12:42:53 -0000 Received: (from corinna@localhost) by cygbert.vinschen.de (8.11.6/8.9.3/Linux sendmail 8.9.3) id g83CgHW17596 for cygwin@cygwin.com; Tue, 3 Sep 2002 14:42:17 +0200 Date: Tue, 03 Sep 2002 05:42:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: A Simple Real World Benchmark for cygwin Message-ID: <20020903144217.C12899@cygbert.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <20020902155542.GC14051@redhat.com> <20020902220234.GA22844@redhat.com> <20020903102756.V12899@cygbert.vinschen.de> <1031045914.3d74831ad243d@mail.broadpark.no> <20020903135135.Z12899@cygbert.vinschen.de> <1031054399.31077.52.camel@lifelesswks> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1031054399.31077.52.camel@lifelesswks> User-Agent: Mutt/1.3.22.1i X-SW-Source: 2002-09/txt/msg00073.txt.bz2 On Tue, Sep 03, 2002 at 09:59:57PM +1000, Robert Collins wrote: > On Tue, 2002-09-03 at 21:51, Corinna Vinschen wrote: > > > Yep, that's the problem. And the reasoning for calling CoInit/CoUnint > > always as pair here since there's no way to rely on that the application > > will *not* call CoUnit somewhere in the middle of its processing. > > If it does, and it didnt' call CoInit, it is an application bug, and not > our problem. Thats why there is the requirement to pair the calls - to > allow us to call it once when we need it, and once on shutdown. If we > need to call it once per thread, then IMO we simply set a per-thread > flag when we have called it. That's not the point. The application *may* call CoInit() before requesting the first path to a shortcut and it *may* call CoUninit() before requesting another path to a shortcut, all in the same thread. The CoInit/CoUnint brace in shortcut.c is safe against that: Application Cygwin-DLL CoInit() lstat() -> CoInit() CoUninit() CoUninit() lstat() -> CoInit() CoUninit() while storing our own state is not safe: Application Cygwin-DLL CoInit() CoInit() lstat() -> ok CoUninit() lstat() -> ??? To workaround that situation, Cygwin would have to call CoInit() anyway to know it's state. Since that requires to be balanced according to MSDN... Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin@cygwin.com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/