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: <4464E6D0 DOT 1C835CBC AT dessent DOT 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 AT ns1 DOT anodized DOT com X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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/