X-Spam-Check-By: sourceware.org
Date: Sun, 14 May 2006 17:58:07 -0700
From: clayne@anodized.com
To: cygwin@cygwin.com
Subject: Re: Fwd: Got any 'fileno_unlocked'?
Message-ID: <20060515005807.GI1783@ns1.anodized.com>
References: <dff7d7110605120914s1f4229d6w77f8057ce7e2173f@mail.gmail.com> <dff7d7110605120915p1fe3e0e6m5287dc30a13633a4@mail.gmail.com> <dff7d7110605121239y58fd3cfble9d3dcbcb589c45f@mail.gmail.com> <4464E6D0.1C835CBC@dessent.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4464E6D0.1C835CBC@dessent.net>
User-Agent: Mutt/1.5.11
X-Assp-Spam-Prob: 0.00000
X-Assp-Whitelisted: Yes
X-Assp-Envelope-From: clayne@ns1.anodized.com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Fri, May 12, 2006 at 12:49:36PM -0700, Brian Dessent wrote:
> 
> It has nothing to do with file locking, but rather locking in the sense
> of thread-safety.  A programmer can call the _unlocked version of a
> number of functions when he is sure that the application only has one
> thread, and avoid a very slight penalty of having to set a mutex before
> modifying the data structures.
>[...]
> Furthermore, these _unlocked functions are *not* standardized functions,
> they are GNU extensions, and this means the programmer has made his code
> unportable by assuming they exist without the aid of a configure test. 
> This is a bad thing to do.
> 
> Brian

Shouldn't the existance of .*_unlocked functions come into scope
after defining _REENTRANT ? I know that even on Solaris, you will
see malloc_unlocked() etc. calls, but mainly in threads programs.

Even including a threaded header (pthreads.h, thread.h) should
define _REENTRANT, so the specific definition isn't necessarily
required but I just wonder why a developer would go out of their
way to even call these backend functions. Bad mojo there for sure.

-cl

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

