From owner-freebsd-threads@freebsd.org Thu Dec 24 19:14:15 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 67D55A517E2; Thu, 24 Dec 2015 19:14:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D05331608; Thu, 24 Dec 2015 19:14:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBOJE89k074931 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 24 Dec 2015 21:14:09 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBOJE89k074931 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBOJE80T074930; Thu, 24 Dec 2015 21:14:08 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 24 Dec 2015 21:14:08 +0200 From: Konstantin Belousov To: Daniel Eischen Cc: John Baldwin , freebsd-arch@freebsd.org, freebsd-threads@freebsd.org Subject: Re: libthr shared locks Message-ID: <20151224191408.GA3625@kib.kiev.ua> 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 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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 19:14:15 -0000 On Thu, Dec 24, 2015 at 01:46:25PM -0500, Daniel Eischen wrote: > 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. Yes, we do. I intend to do this as the next stage, planned the implementation and did some preparations for it in the current patch. This raises the question, why do you suppose that my approach with the off-page would not allow it ? I am asking not to argument, but to understand a possible shortcoming in the approach, which I missed. >From the implementation PoV, off-page is completely equivalent to the in-line structs approach, and the difference is only in the initial translation of say pthread_mutex_t to the structure (off-page lookup vs. identity). The issues with maintaining the lists of the owned robust of pi mutexes are same, and in fact you could see some non-trivial traces of this in the _mutex_fork() reimplementation in my patch. Linux and Solaris get (large enough) structs early enough to avoid the ABI issues. I remember Linux changing FILE layout in early days of glibc 2.0 and resulting pain, while they already had the GNU symbol versioning working and used.