Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 Date: Wed, 5 May 2004 19:01:01 -0500 From: Brian Ford Reply-To: cygwin AT cygwin DOT com To: Steve Thompson cc: cygwin AT cygwin DOT com Subject: Re: pthreads and sockets - Cannot register window class error In-Reply-To: Message-ID: References: <4098760F DOT CDB4F630 AT hot DOT pl> <4098E04B DOT 34D2866B AT dessent DOT net> <20040505210340 DOT GB321 AT coe DOT bosbc DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes On Wed, 5 May 2004, Steve Thompson wrote: > On Wed, 5 May 2004, Christopher Faylor wrote: > > > Unless HOST is a numeric IP address, gethostbyname should be properly > > reentrant. The only time gethostbyname is not thread safe is when it is > > resolving a numeric IP. > > I believe that gethostbyname(), since it is returning a pointer to a > statically allocated structure, cannot be thread safe under any > circumstances. I always wrap it with a mutex until I'm done with the > hostent structure. That's a good portable practice. But, if your going to essentially call cgf a lyer, please at least check the source. He uses a thread specific buffer to return that data. It's obvious if you look. -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International the best safety device in any aircraft is a well-trained pilot... -- 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/