public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: William Tambe via Libc-help <libc-help@sourceware.org>
Subject: Re: Can TLS be implemented switching from MAP_SHARED to MAP_PRIVATE a page reserved for TLS variables ??
Date: Tue, 07 Apr 2020 11:11:12 +0200	[thread overview]
Message-ID: <87pncj8xu7.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <CAF8i9mPe0-fMFqrY_F05Gz-Ruyp-ftuHhOnWhShfhAc8EGZJQw@mail.gmail.com> (William Tambe via Libc-help's message of "Mon, 6 Apr 2020 19:57:34 -0400")

* William Tambe via Libc-help:

> Can TLS be implemented switching from MAP_SHARED to MAP_PRIVATE a page
> reserved for TLS variables ?

Backing storage for some TLS variables will still be allocated using
malloc, so this has only limited effect in any case.

> Switching such a page from MAP_SHARED to MAP_PRIVATE would effectively
> make it local to that thread.

NPTL depends on the TCB be accessible across different threads, so this
is not possible.

C makes cross-thread access implementation-defined, but I expect that
quite a few programs expect it to work, so you may have to support is an
extension.

Thanks,
Florian


      parent reply	other threads:[~2020-04-07  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 23:57 William Tambe
2020-04-07  0:01 ` Godmar Back
2020-04-07  9:11 ` Florian Weimer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pncj8xu7.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).