This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Add the __libc_single_threaded variable
- From: Szabolcs Nagy <Szabolcs dot Nagy at arm dot com>
- To: Florian Weimer <fweimer at redhat dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Cc: nd <nd at arm dot com>
- Date: Fri, 4 Oct 2019 10:14:11 +0000
- Subject: Re: [PATCH] Add the __libc_single_threaded variable
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PwtwAd7eXMJvlQiUdWt1erTz2+9ZZiethWyPWUqysLM=; b=bruajo4xhKLLO0ynaCh6C52/jUcs0KxR5qFCoTLd1zUPOx5YHcWQm9N3PyElhpx8NOOijW8thLLak7OKKdpeF7kQZElksg77BdwS9HvsNDmZrcOieQpJ6uKUcIOZEGL1EUqDBy+f1RklO7NonMWd52TDQ/8X6DBFE3jkdKq0d4YHp6v328fASbpS5AdY4aw7ycvUQUN5gjF51cV8mqX35R3AVL+TWIxF6FUNW8y0xfbPO3lLxAXf3gbtptOYGo/jaZ6TgtxBtfKUeOIFWJlUm192rEku6kC0XKs/ZHFjbn1TNfUmkLMn6cJPRkGEFvy0jhfnujKe9WluuMUNJcdUzQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N5PLLfd1uiv5h+0vqUifSN7Nu8VvuyTD0gqFIGce563cIrbFwqL0zx2UUs9tICnKEEmaYyAeI8aZPuuvqxDis3SyI1bAnFUy7jX+MZmVjslhMTcBGrME4lvuLa87iDm9L/Tw3mDH5x1Zv3x5WIx7tya/16zoCjRM+c4A58UgmsE6sLDZHZJ0L22Y4o4lB0kHDPIS+3+qVYk32DSZCJUF+WQ38qhfhHC0M0lTE9QevTkXmZ385ZbLgkKbodUuaLxxTrCqPWUx8fRdnBZ3z1zNqoFo7bo98KygJeRWZqPSHCm7mBjldnJV6pfmhRsfcHj/5mSR5CDlG05PtlxFACQyQQ==
- Original-authentication-results: spf=none (sender IP is ) smtp.mailfrom=Szabolcs dot Nagy at arm dot com;
- References: <87blwpyo45.fsf@oldenburg2.str.redhat.com> <87a7agj0gp.fsf@oldenburg2.str.redhat.com>
On 04/10/2019 10:59, Florian Weimer wrote:
> * Florian Weimer:
>
>> This version is based on the earlier feedback that a simple global
>> variable should be used instead
>>
>> <https://sourceware.org/ml/libc-alpha/2019-02/msg00073.html>
>>
>> and the benchmarking results suggesting that this is feasible:
>>
>> <https://sourceware.org/ml/libc-alpha/2019-06/msg00954.html>
>>
>> The implementation is somewhat complicated by copy relocations, which
>> are not applied to the inner namespace.
>>
>> This is probably the simplest possible implementation. It does not
>> attempt to reset the variable if there is only one thread left.
>
> I'm going to post an implementation based on the early-init work for the
> rseq addition. This way, we can keep the variable in libc.so instead of
> the loader, which is somewhat cleaner conceptually.
thanks for working on this.
(recently there was another gcc bugreport about gthr
weakrefs with static linking breaking libgcc_eh on
*-linux-musl, __libc_single_thread can solve that)