[b]CONTENTS[/b]
Overview of the Native Threads Pack
System Requirements
Installation
Using the Native Threads Pack
- The THREADS_FLAG environment variable
- The -native and -green convenience options
[b]OVERVIEW OF THE NATIVE THREADS PACK[/b]
When you install the Native Threads Pack, the Java virtual machine (VM)
is able to use native threads when running Java code. Native threads
can provide several advantages over the default threads package (called
green threads), depending on your computing situation. Among the
benefits of using the native threads VM are:
- If you run Java code in a multi-processor environment, the
Solaris kernel can schedule native threads on the parallel
processors for increased performance. By contrast, green
threads exist only at the user-level and are not mapped to
multiple kernel threads by the operating system. Performance
enhancement from parallelism cannot be realized using green
threads.
- The native threads VM can call into C libraries that use
Solaris native threads. Such libraries cannot be used with
green threads.
- When using the native threads, the VM can avoid some
inefficient remapping of I/O system calls that are necessary
when green threads are used.
In some instances, it may be advisable to use the default green
threads. Native code that is not multithread safe (MT-safe) may not
work correctly with native threads. In general, if you aren't using
the native Solaris threads mechanisms directly, then you need to
compile your native code with the option -D_REENTRANT to make sure
that they work correctly in a threaded environment. You may also need
to use reentrant versions of certain Solaris interfaces.
Overview of the Native Threads Pack
System Requirements
Installation
Using the Native Threads Pack
- The THREADS_FLAG environment variable
- The -native and -green convenience options
[b]OVERVIEW OF THE NATIVE THREADS PACK[/b]
When you install the Native Threads Pack, the Java virtual machine (VM)
is able to use native threads when running Java code. Native threads
can provide several advantages over the default threads package (called
green threads), depending on your computing situation. Among the
benefits of using the native threads VM are:
- If you run Java code in a multi-processor environment, the
Solaris kernel can schedule native threads on the parallel
processors for increased performance. By contrast, green
threads exist only at the user-level and are not mapped to
multiple kernel threads by the operating system. Performance
enhancement from parallelism cannot be realized using green
threads.
- The native threads VM can call into C libraries that use
Solaris native threads. Such libraries cannot be used with
green threads.
- When using the native threads, the VM can avoid some
inefficient remapping of I/O system calls that are necessary
when green threads are used.
In some instances, it may be advisable to use the default green
threads. Native code that is not multithread safe (MT-safe) may not
work correctly with native threads. In general, if you aren't using
the native Solaris threads mechanisms directly, then you need to
compile your native code with the option -D_REENTRANT to make sure
that they work correctly in a threaded environment. You may also need
to use reentrant versions of certain Solaris interfaces.