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 X-Authentication-Warning: thing1-200.fsi.com: ford owned process doing -bs Date: Wed, 14 Apr 2004 12:05:59 -0500 (CDT) From: Brian Ford X-X-Sender: ford AT thing1-200 Reply-To: cygwin AT cygwin DOT com To: Enzo Michelangeli cc: cygwin AT cygwin DOT com Subject: Re: 1.5.9-1: socket() appears NOT to be thread-safe In-Reply-To: <00c901c4220d$47f6eaa0$0200a8c0@em.noip.com> Message-ID: References: <00c901c4220d$47f6eaa0$0200a8c0 AT em DOT noip DOT com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes On Wed, 14 Apr 2004, 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? FWIW, I have seen this symptom as well, primarily on a dual CPU, Hyperthreaded XP box under 1.5.[8|9]+. In fact, I just confirmed it still exists in a current CVS build from this morning. It seems like a race condition. Running under strace fixes it, so it has been difficult to isolate. If I have time, I'll try to look at it again soon. Would you like to work on it together? -- Brian Ford Senior Realtime Software Engineer VITAL - Visual Simulation Systems FlightSafety International Phone: 314-551-8460 Fax: 314-551-8444 -- 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/