Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com Date: Thu, 1 Nov 2001 06:32:33 -0500 From: Jason Tishler To: Robert Collins Cc: cygwin-developers AT sourceware DOT cygnus DOT com Subject: Re: fix cond_race... was RE: src/winsup/cygwin ChangeLog thread.cc thread.h ... Message-ID: <20011101063233.A796@dothill.com> Mail-Followup-To: Robert Collins , cygwin-developers AT sourceware DOT cygnus DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00d501c15fd8$711598e0$0200a8c0@lifelesswks> User-Agent: Mutt/1.3.18i Rob, On Mon, Oct 29, 2001 at 04:46:14AM +1100, Robert Collins wrote: > I've fresh out of ideas. > > [snip] Please don't interpret my sluggish response time as a lack of interest or appreciation of your efforts. Quite on the contrary, I was blown away by your analysis and the obvious effort that you spent debugging this problem on my machine. Unfortunately, I'm maxed out due to starting a new job and already having multiple unreasonable deadlines. Sigh... > BTW: in thread.cc in your cygwin source, you might like to change s = !s > to s= (s+1) % 2; I'm not sure that !s is guaranteed to give you Sleep > (1) :}. I just stole the idea and code from Python itself -- I'll verify that s = !s works as expected and if not, then I'll try your alternative. > Now the python thread header seems a little buggy to me. > 1) the lock struct member locked should be volatile. (Do you have an SMP > system Jason?) No, I just have a single PIII 500 MHz processor. > 2) ..acquire_lock can exit with the lock marked as owned, but return an > error. If the calling function assumes that an error from acquire_lock > means it' failed to acquire the lock, the lock will get wedged, and > python will appear to hang. (the if (error) success = 0; line is the > culprit. It should also reset thelock->locked IMO. This is congruent > with the symptoms I see in your case. I will investigate this possibility as soon as I come up for air. Thanks, Jason