From owner-freebsd-threads@freebsd.org Thu Dec 24 18:46:32 2015 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB74A50FAD; Thu, 24 Dec 2015 18:46:32 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A6CB19FA; Thu, 24 Dec 2015 18:46:32 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id tBOIkPHN001165; Thu, 24 Dec 2015 13:46:25 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Thu, 24 Dec 2015 13:46:25 -0500 (EST) Date: Thu, 24 Dec 2015 13:46:25 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: John Baldwin cc: freebsd-arch@freebsd.org, Konstantin Belousov , freebsd-threads@freebsd.org Subject: Re: libthr shared locks In-Reply-To: <5496837.TbTQtANDNj@ralph.baldwin.cx> Message-ID: References: <20151223172528.GT3625@kib.kiev.ua> <4199356.DlQeWDh27F@ralph.baldwin.cx> <5496837.TbTQtANDNj@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Dec 2015 18:46:32 -0000 On Thu, 24 Dec 2015, John Baldwin wrote: > On Thursday, December 24, 2015 08:45:38 AM Daniel Eischen wrote: >> We would include extra/spare words in the struct from day 1. >> The public struct should just consist of an array of storage >> units or similar, so that nothing can be gleaned from the >> elements of the struct. This is what Solaris does (or at least >> used to). >> >> Going forward, I think the sync structures just need to be able >> to be properly initialized with PTHREAD_FOO_INITIALIZER. If >> 10 years out the spare words are not enough, we could still >> allocate remaining storage on first use like we do now. > > You can't allocate extra storage for the PSHARED case. Any changes > to PSHARED primitives that require altering the layout are full-blown > ABI breakages the same as the one being contemplated here. Yes, I know. With spare slots and being able to move anything required for shared to near the beginning of the struct, I think we'd be good for quite a while anyway. Can we still implement things like robust and priority mutexes in a pshared mutex with Konstantin's implementation? The rest of the world (Linux, Solaris anyway) use structs and get by just fine ABI-wise. -- DE