delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2012/11/23/12:30:08

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Fri, 23 Nov 2012 18:29:37 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Possible race in SYSV IPC (semaphores)
Message-ID: <20121123172937.GA12624@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <5F8AAC04F9616747BC4CC0E803D5907D012856 AT MLBXV09 DOT nih DOT gov> <20121123113605 DOT GN17347 AT calimero DOT vinschen DOT de> <20121123131020 DOT GR17347 AT calimero DOT vinschen DOT de> <20121123133332 DOT GU17347 AT calimero DOT vinschen DOT de> <20121123164404 DOT GX17347 AT calimero DOT vinschen DOT de> <5F8AAC04F9616747BC4CC0E803D5907D0162C6 AT MLBXv04 DOT nih DOT gov>
MIME-Version: 1.0
In-Reply-To: <5F8AAC04F9616747BC4CC0E803D5907D0162C6@MLBXv04.nih.gov>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 Nov 23 17:16, Lavrentiev, Anton (NIH/NLM/NCBI) [C] wrote:
> > This should avoid the race (*and* work...)
> > Please give it a try.
> 
> Thanks!  I've tried both patches (pipe race + semadj), and they do seem to work!

Thanks for testing.

> Although (not being a party pooper :-), I think that all the logic
> around "pipe_instance" can now be dropped entirely, and benefit from eliminating
> an unnecessary synchronization point (pipe_instance is now only used
> for logging a proper pipe ID, which is not even seen in regular use,
> and for an assert(), which again is only there in debug mode builds).
> So there is no need to arrange Enter'ing/Leave'ing of the critical section
> to do just the hidden things, yet the working code would be a bit cleaner.

I agree.  I'll do that in the next couple of days.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019