Examine whether -Xrs flag to JVM could be used to improve our signal-handling 
logic
-----------------------------------------------------------------------------------

                 Key: JRUBY-2608
                 URL: http://jira.codehaus.org/browse/JRUBY-2608
             Project: JRuby
          Issue Type: Improvement
            Reporter: Charles Oliver Nutter
            Assignee: Thomas E Enebo
             Fix For: JRuby 1.1.3


The -Xrs flag turns off the JVM's use of signal handlers that might otherwise 
be used for Ruby programs in JRuby. It could be useful for us. From the docs:

{noformat}
-Xrs
    Reduces use of operating-system signals by the Java virtual machine (JVM).

    In a previous release, the Shutdown Hooks facility was added to allow 
orderly shutdown of a Java application. The intent was to allow user cleanup 
code (such as closing database
 connections) to run at shutdown, even if the JVM terminates abruptly.

    Sun's JVM catches signals to implement shutdown hooks for abnormal JVM 
termination. The JVM uses SIGHUP, SIGINT, and SIGTERM to initiate the running 
of shutdown hooks.

    The JVM uses a similar mechanism to implement the pre-1.2 feature of 
dumping thread stacks for debugging purposes. Sun's JVM uses SIGQUIT to perform 
thread dumps.

    Applications embedding the JVM frequently need to trap signals like SIGINT 
or SIGTERM, which can lead to interference with the JVM's own signal handlers. 
The -Xrs 
command-line option is available to address this issue. When -Xrs is used on 
Sun's JVM, the signal masks for SIGINT, SIGTERM, SIGHUP, and SIGQUIT are not 
changed by the 
JVM, and signal handlers for these signals are not installed.

    There are two consequences of specifying -Xrs:

        * SIGQUIT thread dumps are not available.
        * User code is responsible for causing shutdown hooks to run, for 
example by calling System.exit() when the JVM is to be terminated.

{noformat}

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to