NonStop Server for Java 7.0 Programmer's Reference

timer callbacks and detection of I/O completions can be severely impacted by long-running
threads.
You must be careful when using thread-aware interfaces.
The Open System Services Programmer’s Guide lists thread-aware equivalents of NonStop
system-specific interfaces. These interfaces have an explicit put_ prefix.
For example, when using a thread-aware function, do not attempt to control the set of files
that are enabled for completion or directly attempt to wait for a completion on a file registered
with Pthreads (FILE_COMPLETE_SET_, FILE_COMPLETE_, AWAITIO, or AWAITIOX
procedure).
Pthread library changes
Pthreads library provides the following functionality:
The PUT library converts all I/O calls as nonblocking calls. If a thread invokes an I/O, the
call blocks only the calling thread and not the application. This enables porting of Java
applications to NSJ7.
The PUT library provides features that allow Java applications to be more robust are described
as follows:
Protected thread stack – In earlier versions of NSJ, the Java thread stack was unprotected
and hence the JVM only detected stack overflow caused by Java methods. This was done
by stack boundary checking code in interpreted and hotspot compiled code. It was
possible for native methods to overflow the stack space erroneously and corrupt the
program data. In NSJ7, the PUT library protects the thread stacks by using guard pages.
JVM uses this Pthread feature to catch stack overflow from native methods. A stack overflow
from native method causes a SIGSTK signal.
Signal handler uses new stack called alternate signal stack - This enables JVM to execute
the signal handler code for SIGSTK signal.
Provides standard POSIX thread API names and calling sequences which adhere to IEEE
standard 1003.1, 2004. For more information, see Open System Services Programmer's
Guide.
For more information on Pthread library, see Open System Services Porting Guide.
ThreadDumpPath support
The thread dump lists all threads in the Java process. If any of the distributed GC options are
enabled, GC threads are converted into processes. Hence, the GC threads are prefixed with * to
indicate that it is a process if the application enables distributed GC.
The execution stack trace of all Java threads in a NSJ7 process can be dumped by sending a
SIGQUIT signal to the Java process using the following OSS command:
$ kill -QUIT <pid>
NOTE: GC thread stack trace is not printed.
By default, the thread stack dump is written in text format on the stdout. NSJ7 provides the ability
to redirect this output to a user-defined file using the following Java command:
-XX:ThreadDumpPath=<path/filename>
Java print service
The Java Print Service (JPS) implemented in NSJ7 uses the headless version of the javax.print API.
JPS allows you to print on printers directly to NonStop systems and to network printers attached to
a local area network (LAN) or wide area network (WAN). For information on configuring network
44 Implementation specifics