On Wed, 21 Sep 2022 23:12:13 GMT, David Holmes <dhol...@openjdk.org> wrote:

> Hi Roger, Using the spawn attributes seems more far reaching than simply 
> temporarily changing the signal mask of the calling thread. I'd be concerned 
> this has some unintended side-effects.

@dholmes-ora The signal masks for threads are currently initialized and managed 
by the VM. I was concerned about application actions and Java code changing and 
then restoring the mask in the face of possible async behaviors. It seemed 
cleaner for the changes to affect only the child.

Posix_spawn is used on all platforms and is very specific about its actions.
I considered just resetting the mask for SIGQUIT, copying the rest of the 
signal mask from the parent, but then it might come up that some other signal 
was masked and should not be.

The launching of a new executable is a two+ step process. A small executable 
(jspawnhelper) is spawned and it does the exec of the requested executable. 
An alternate implementation is to have jspawnhelper reset its own signal mask 
before exec'ing the target application.

-------------

PR: https://git.openjdk.org/jdk/pull/10379

Reply via email to