From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 539013858D1E for ; Thu, 19 Oct 2023 21:00:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 539013858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 539013858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=45.83.234.184 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697749246; cv=none; b=ZEMgFSWMrrz7YdWoTTGO+5vQJYXl9fJEp7dVPRqoyVxge6g68amYmNgnAdAvGbnhg6PF1w5tu7FZY9kW8+HTr+3DN0qo3vSjt7ZrJjyXC/m+tCpdTmHsQ+T3xLcGBI+w34SV+VImC2oTmaVvWe6+3QadgeTTFylKJy81O9vmawk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697749246; c=relaxed/simple; bh=zh1H781YDbHj19J5G7AuXqF33Y4wvrZhHFKbxH7y7TQ=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=l3dnXv38RJk04UehybnJHpYe6nAlYIKWKt0Hk3BYE0Aj88MvBhexvlCXYQlG9r8khqH3yxOpKAOY8D5n75aqaacglV17cjMwiDdiqo2AgM7NUuQcR5HOw/7UJLsGjsDJsVxsNJjuODV8mUm+qjDIP0SH1PAQp5du9pS3volrUrI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 42026302FDCA; Thu, 19 Oct 2023 23:00:41 +0200 (CEST) Date: Thu, 19 Oct 2023 23:00:41 +0200 From: Mark Wielaard To: Heather McIntyre Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH 02/16] libelf: Make elf_version thread-safe Message-ID: <20231019210041.GD14066@gnu.wildebeest.org> References: <301fac87e83ebbbd677750579ae9a3429b461bdf.camel@klomp.org> <20231010134300.53830-1-mark@klomp.org> <20231010134300.53830-2-mark@klomp.org> <99c0df19c4fe86f9142597b62fedac1bc1b85e75.camel@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-3028.4 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Heather, On Tue, Oct 17, 2023 at 02:05:58PM -0500, Heather McIntyre wrote: > John and I discussed that atomic_compare_exchange_strong could have been > used here. I see that this has been pushed to the main branch, but I can > make the change to the atomic operation if you think that is a better > option. It probably doesn't matter for this function since it isn't used often. I was just wondering whether you thought of using atomics here since there are really just two states here (__libelf_version == EV_NONE or __libelf_version == EV_CURRENT). I do have one question though. __libelf_version is checked in elf_begin. Should that check be guarded by a lock too? Thanks, Mark