setenv JH_INC3 ${JAVAHOME}/include
setenv JH_INC2 ${JAVAHOME}/include/solaris
setenv CLASSPATH .:/export/home/bil/programs/Java/Extensions/classes
# Java's going to get the interface code from .
setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:.
# Tell Java to use native threads.
setenv THREADS_FLAG native
${JAVAHOME}/bin/javac *.java
${JAVAHOME}/bin/javah -stubs Test
${JAVAHOME}/bin/javah -jni Test
cc -G -I${JH_INC3} -I${JH_INC2} PThreadsInterface.c -lthread \
-o libPThreadsInterface.so
Other Programs on the Web
There are a small series of other programs on the Web page that may be of some interest. Each of
them has points of interest, but none of them is sufficiently interesting for us to print in its entirety.
You may well find the programs helpful in clarifying details about how to write code for specific
situations and for how to use the APIs. Several are variations of the programs in previous chapters,
and several are simple test programs which illustrate how some of the fancier extension functions
work, such as FIFO mutexes, recursive mutexes, mutexes with timeouts.
Summary
Several Java programs were shown, each with a certain point to elucidate. As with all the example
programs, translation to POSIX or Win32 is (supposed to be) straightforward and is left as an
exercise for the reader.
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home