From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5801 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Explaining cond var destroy [Re: [musl] C threads, v3.0] Date: Mon, 11 Aug 2014 22:50:13 -0400 Message-ID: <20140812025013.GY1674@brightrain.aerifal.cx> References: <1407365015.24324.334.camel@eris.loria.fr> <20140806231539.GE1674@brightrain.aerifal.cx> <1407397851.24324.354.camel@eris.loria.fr> <20140807161342.GH1674@brightrain.aerifal.cx> <1407430024.24324.387.camel@eris.loria.fr> <20140807172514.GI1674@brightrain.aerifal.cx> <1407489627.24324.419.camel@eris.loria.fr> <20140808191405.GP1674@brightrain.aerifal.cx> <20140808204855.GQ1674@brightrain.aerifal.cx> <1407566854.4988.231.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1407811833 20378 80.91.229.3 (12 Aug 2014 02:50:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Aug 2014 02:50:33 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5806-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 12 04:50:28 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XH2AN-0008O6-FN for gllmg-musl@plane.gmane.org; Tue, 12 Aug 2014 04:50:27 +0200 Original-Received: (qmail 3771 invoked by uid 550); 12 Aug 2014 02:50:26 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 3763 invoked from network); 12 Aug 2014 02:50:26 -0000 Content-Disposition: inline In-Reply-To: <1407566854.4988.231.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5801 Archived-At: On Sat, Aug 09, 2014 at 08:47:34AM +0200, Jens Gustedt wrote: > > Any further thoughts on the matter? I think we should finish the > > private futex support task before starting on this, so that we don't > > do new work that's going to conflict with a pending patch. > > This looks promissing, but I yet don't know enough about these less > common futex operations to comment more on it. You may want to see my comments here which relate to it: https://sourceware.org/bugzilla/show_bug.cgi?id=13690 > Generally I think that the control structures should be as tight as > possible, give provable properties in the mathematical sense. The > interaction between user- and kernelland should be minimal, and we > shouldn't provoque reactions of the kernel that concern threads (or > even process) that are not really targetted. The former (provable properties) is definitely a goal we should not deviate from. But I don't think the current spurious futex wakes conflict with that goal. The latter (not provoking reactions in untargetted threads) is a desirable goal, but not if it conflicts with more important goals like avoiding unnecessary allocation (actually, I don't think it's possible to solve the problem with allocation; I think an additional layer of allocation just makes it worse), fail-safety, performance, etc. On the other hand, I think it's going to be possible to get both without sacrificing anything, and moreover I think we can even, if we want to, provide guaranteed mutex acquisition order (whatever order the kernel gives, which is probably fifo or fifo within priority levels). I'll write up the concept for the latter in case there's interest in doing it. It might avoid the problem even without using FUTEX_WAKE_OP. Rich