Date: Mon, 11 Aug 2014 22:50:13 -0400 From: Rich Felker <dalias@...c.org> To: musl@...ts.openwall.com Subject: Re: Explaining cond var destroy [Re: C threads, v3.0] 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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.