From owner-freebsd-arch@freebsd.org Mon Feb 15 14:44:17 2016 Return-Path: Delivered-To: freebsd-arch@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 D6A79AA89E7 for ; Mon, 15 Feb 2016 14:44:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id C2AA512D4 for ; Mon, 15 Feb 2016 14:44:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id BE2FCAA89E5; Mon, 15 Feb 2016 14:44:17 +0000 (UTC) Delivered-To: arch@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 BDB16AA89E4; Mon, 15 Feb 2016 14:44:17 +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 59EAC12D3; Mon, 15 Feb 2016 14:44:17 +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 u1FEiAQQ029016 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 15 Feb 2016 16:44:10 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u1FEiAQQ029016 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u1FEiAfr029015; Mon, 15 Feb 2016 16:44:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Feb 2016 16:44:10 +0200 From: Konstantin Belousov To: Martin Simmons Cc: vangyzen@FreeBSD.org, threads@FreeBSD.org, arch@FreeBSD.org Subject: Re: libthr shared locks Message-ID: <20160215144410.GT91220@kib.kiev.ua> References: <20151223172528.GT3625@kib.kiev.ua> <56BE69B8.9020808@FreeBSD.org> <20160213143815.GB91220@kib.kiev.ua> <201602151417.u1FEHKwL003392@higson.cam.lispworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201602151417.u1FEHKwL003392@higson.cam.lispworks.com> 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-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2016 14:44:17 -0000 On Mon, Feb 15, 2016 at 02:17:20PM +0000, Martin Simmons wrote: > Is pthread_barrier_destroy making the wrong comparison? > > + if (barrier == THR_PSHARED_PTR) { > > I think this should be *barrier. You are right, thank you for noticing. I uploaded https://www.kib.kiev.ua/kib/pshared/pshared.3.patch > > Also, a general question: why not use some flag in the barrier (and other > objects) to indicate pshared, removing the need for __thr_pshared_offpage > except in init? But where would I keep the object ? All that I have with the current ABI is a single pointer, which de facto behaves like the flag which you proposed. It is either real pointer or (if set to some specific value impossible for a valid pointer) there is an offpage.