delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/05/14/20:58:32

X-Spam-Check-By: sourceware.org
Date: Sun, 14 May 2006 17:58:07 -0700
From: clayne AT anodized DOT com
To: cygwin AT cygwin DOT com
Subject: Re: Fwd: Got any 'fileno_unlocked'?
Message-ID: <20060515005807.GI1783@ns1.anodized.com>
References: <dff7d7110605120914s1f4229d6w77f8057ce7e2173f AT mail DOT gmail DOT com> <dff7d7110605120915p1fe3e0e6m5287dc30a13633a4 AT mail DOT gmail DOT com> <dff7d7110605121239y58fd3cfble9d3dcbcb589c45f AT mail DOT gmail DOT com> <4464E6D0 DOT 1C835CBC AT dessent DOT net>
Mime-Version: 1.0
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 AT ns1 DOT anodized DOT com
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
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

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/

- Raw text -


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