NonStop Server for Java 5.1 Programmer's Reference

header files for this version of POSIX threads can be found in the directory:
[install-dir]/java/include/oss
where install-dir is the NonStop Server for Java 5.1 installation directory.
Creating a thread for a task does not make the task run faster.
The NonStop system does not have an implementation of native threads; threads run at a user level. Even on
a multiprocessor NonStop system, all threads in a process are executed in the same processor as the process.
If you create a thread whose only purpose is to run a certain task, the thread-creation overhead makes the
task run marginally slower than the same task being performed without creating the thread.
The thread-scheduling algorithm is not preemptive.
A thread executes until it explicitly yields. For more information, see the discussion of Thread Scheduling.
In a very long-running, CPU-intensive thread, having your native code occasionally invoke the yield()
method allows timer completions and I/O completions to be detected. Invocation of timer callbacks and
detection of I/O completions can be severely impacted by long-running threads.
Be familiar with the issues discussed in the Application Programming with Standard POSIX Threads
section of the OSS Programmers Guide.
This section contains information about the jacket routines that make many of the available system calls
thread-aware. The interfaces themselves, however, are documented in the OSS System Calls Reference
Manual.
To use these jacket routines, you need to add the following define in your native code.
#define SPT_THREAD_AWARE
Adding this define in the native C/C++ code, transparently provides you the thread-aware equivalents of
many of the interfaces, for example, the Socket interface. Additionally, the interfaces are available to
determine if a socket is read-ready (spt_fd_read_ready) or write-ready (spt_fd_write_ready).
The Socket implementation on NonStop systems supports streaming; multiple sends and receives are
outstanding at a time.
Be careful when using thread-aware interfaces.
The OSS Programmers Guide lists thread-aware equivalents of NonStop system-specific interfaces. These
interfaces have an explicit spt_ 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).