public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Szabolcs Nagy <szabolcs.nagy@arm.com>
Cc: libc-alpha@sourceware.org,
	Michael Kerrisk <mtk.manpages@gmail.com>,
	Rich Felker <dalias@libc.org>
Subject: Re: [PATCH v2 2/2] manual: Document __libc_single_threaded
Date: Tue, 30 Jun 2020 10:56:22 +0200	[thread overview]
Message-ID: <878sg5szih.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <20200625120854.GI16726@arm.com> (Szabolcs Nagy's message of "Thu, 25 Jun 2020 13:08:55 +0100")

* Szabolcs Nagy:

> linux has several syscalls that change some property of
> the current thread and get inherited by new threads
> (e.g. setxid, various prctls, signal mask) and a user
> may want to set such property for the entire process
> and bail out if that cannot work, so the question is
> if __libc_single_threaded works for this? even if this
> is done in a signal handler? e.g.
>
> if (__libc_single_thread)
>   prctl(set_property,a2,a3,a4,a5); // entire process ok
> else
>   bailout(); // there might be other threads
>
> i think this may be another valid usage (not related
> to atomics).

In theory, that could be the case, but the question is what you do in
the bailout case.

Thanks,
Florian


  reply	other threads:[~2020-06-30  8:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 12:59 [PATCH v2 1/2] Add the __libc_single_threaded variable Florian Weimer
2020-06-24 13:03 ` [PATCH v2 2/2] manual: Document __libc_single_threaded Florian Weimer
2020-06-25 12:08   ` Szabolcs Nagy
2020-06-30  8:56     ` Florian Weimer [this message]
2020-06-30  1:06   ` DJ Delorie
2020-06-30  8:57     ` Florian Weimer
2020-06-30  0:52 ` [PATCH v2 1/2] Add the __libc_single_threaded variable DJ Delorie
2020-06-30  9:24   ` Florian Weimer

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=878sg5szih.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=dalias@libc.org \
    --cc=libc-alpha@sourceware.org \
    --cc=mtk.manpages@gmail.com \
    --cc=szabolcs.nagy@arm.com \
    /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).