X-Spam-Check-By: sourceware.org Date: Thu, 28 Jun 2007 22:28:22 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Multithreaded accept/connect locks Message-ID: <20070628202822.GN30973@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <3b80b53b5dae DOT 3b5dae3b80b5 AT drexel DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3b80b53b5dae.3b5dae3b80b5@drexel.edu> User-Agent: Mutt/1.4.2.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: 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 Jun 28 16:17, wtk25 AT drexel DOT edu wrote: > On Jun 27 19:08, Corinna Vinschen wrote: > > Yes, that's the same problem. From stracing the problem it appears > > that the underlying problem is in WinSock. connect returns with an > > error 10036, WSAEINPROGRESS, because the other thread is at that > > time executing a blocking socket call (accept). The problem is > > aggravated by the fact that the connect call in Cygwin is always > > using non-blocking mode and WSAEINPROGRESS is also referring to a > > connect which is still in progress and needs further handling. > > With the 's' option, my previous program blocked on select() instead > of accept(), so connect() must also collide with select(). Yes, that's expected. > > In CVS, the Cygwin socket code has been reworked a lot. One > > important change is that besides recv/send/connect also accept is > > now implemented in non-blocking mode under the hood. This has the > > effect that the connect call should't be able to fail due to a > > blocking accept in the same process. If you try your application > > against a recent snapshot from http://cygwin.com/snapshots/, your > > test application will run as expected. > > I'd like to keep this in a standard Cygwin distribution if possible. You'll have to live with the behaviour in 1.5.24 then for some time. There won't be any bug fixing to 1.5.24 anymore. The next version will be a major, major, MAJOR update with lots of changes, not only in socket code. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- 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/