From: Till Varoquaux <till@pps.jussieu.fr>
To: linux-kernel@vger.kernel.org
Subject: fork and sigprocmask as an atomic operation?
Date: Fri, 13 May 2011 00:48:22 -0400 [thread overview]
Message-ID: <BANLkTim_dH2skkaK5NKNrEMjfPSOyEq2rA@mail.gmail.com> (raw)
If I understand properly the idiomatic way to set the signal mask in a
forked of process is to block all signals in the parent process before
calling fork and then setting the desired mask in both processes.
sigprocmask()
..... <-- All the signals are going to be put in the pending list
clone ()
......
sigprocmask() <-- release all the pending signals that we care about.
Now; unless I am missing something this does not seem to play well
with threads. Providing several threads go through that exact dance at
the same time it seems as could this result in the application ending
up with the wrong signal mask?
Is there any good reason to not add a new flag to clone that would
block all signals in the child process?
Cheers,
Til
reply other threads:[~2011-05-13 4:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=BANLkTim_dH2skkaK5NKNrEMjfPSOyEq2rA@mail.gmail.com \
--to=till@pps.jussieu.fr \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®