[<prev] [next>] [day] [month] [year] [list]
Message-ID: <BANLkTim_dH2skkaK5NKNrEMjfPSOyEq2rA@mail.gmail.com>
Date: Fri, 13 May 2011 00:48:22 -0400
From: Till Varoquaux <till@....jussieu.fr>
To: linux-kernel@...r.kernel.org
Subject: fork and sigprocmask as an atomic operation?
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists