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, 14 Apr 2004 15:22:21 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 1.5.9-1: socket() appears NOT to be thread-safe Message-ID: <20040414132221.GM26558@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <00c901c4220d$47f6eaa0$0200a8c0 AT em DOT noip DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00c901c4220d$47f6eaa0$0200a8c0@em.noip.com> User-Agent: Mutt/1.4.2i On Apr 14 18:42, Enzo Michelangeli wrote: > While porting to Cygwin the Linux application "sipd" > (http://www.sxdesign.com/index.php?page=developer&submnu=sipd ), which > uses pthreads, I noticed that socket() calls issued concurrently by > several threads often failed, with strerror(errno) saying "operation not > permitted". Once I protected all the calls with mutex locks, such errors > went away. Is Cygwin's implementation of socket() known to be > thread-unsafe? No. If you can prepare a brief testcase to demonstrate the problem, I'm happy to fix it. Of course, patches would be most welcome. See below. > P.S. I have written an implementation of the missing gethostbyname_r(), > based on a mutex-protected call to gethostbyname(). If useful, I may > gladly contribute the code. Sure! Unfortunately, that requires us to ask you for a copyright assignment first. See http://cygwin.com/contrib.html for details. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Developer mailto:cygwin AT cygwin DOT com Red Hat, Inc. -- 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/