From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17524 invoked by alias); 26 Oct 2019 16:14:56 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 17513 invoked by uid 89); 26 Oct 2019 16:14:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:606, shallow X-Spam-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: albireo.enyo.de Received: from albireo.enyo.de (HELO albireo.enyo.de) (37.24.231.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 Oct 2019 16:14:53 +0000 Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1iOOiF-0002iP-NK; Sat, 26 Oct 2019 16:14:47 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1iOOiF-0004oz-Kk; Sat, 26 Oct 2019 18:14:47 +0200 From: Florian Weimer To: Mark Wielaard Cc: Jonathon Anderson , elfutils-devel@sourceware.org, Srdan Milakovic Subject: Re: [PATCH] libdw: add thread-safety to dwarf_getabbrev() References: <1565983469.1826.0@smtp.mail.rice.edu> <20190824232438.GA2622@wildebeest.org> <1566695452.979.1@smtp.mail.rice.edu> <5ba06557703ee363e19488c994cbddd92ade25be.camel@klomp.org> <1566782688.5803.0@smtp.mail.rice.edu> <1566826627.5246.0@smtp.mail.rice.edu> <1566877968.10901.0@smtp.mail.rice.edu> <87tv7vg4l0.fsf@mid.deneb.enyo.de> <8fde453a2c570fa150aa39b0dabd0f925c7b0970.camel@klomp.org> Date: Sat, 26 Oct 2019 16:14:00 -0000 In-Reply-To: <8fde453a2c570fa150aa39b0dabd0f925c7b0970.camel@klomp.org> (Mark Wielaard's message of "Sat, 26 Oct 2019 14:06:40 +0200") Message-ID: <87imobfpqg.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00048.txt.bz2 * Mark Wielaard: > I'll see if I can create a case where that is a problem. Then we can > see how to adjust things to use less pthread_keys. Is there a different > pattern we can use? It's unclear what purpose thread-local storage serves in this context. You already have a Dwarf *. I would consider adding some sort of clone function which creates a shallow Dwarf * with its own embedded allocator or something like that. This assumes that memory allocation is actually a performance problem, otherwise you could let malloc handle the details.