JDK 1.1 for Solaris Developer's Guide

API Mapping

The mapping table shows the closest possible mapping of the Java threads API to the Solaris and POSIX APIs. This mapping is not exact and does not imply that you can convert a Solaris or POSIX threads program to a Java threads program (or vice versa) using the table. The table serves only to show a loose equivalence between the APIs and to some guidance to developers familiar with one API and interested in knowing its relationship to the corresponding API. A conceptual difference exists between using the Solaris APIs by way of procedural and layered programming in C, and using them by object-oriented programming techniques in Java.

The following examples show why the Java/Solaris API equivalence is loose.


Note -

The Solaris readers/writer lock interfaces and the POSIX attributes do not have any close equivalent interfaces in Java.


Table 3-3 Mapping of Java to Solaris and POSIX APIs

Java Threads API 

Solaris Threads API 

POSIX Threads API 

 thr_create()pthread_create()
activeCount()  
checkAccess()  
countStackFrames()  
currentThread()thr_self()pthread_self()
destroy() pthread_cancel()
dumpStack()  
enumerate()  
getName()  
getPriority()thr_getprio()pthread_ getschedparam()
getThreadGroup()  
interrupt()thr_kill()pthread_kill()
interrupted()  
isAlive()  
isDaemon()  
isInterrupted()  
join()thr_join()pthread_join()
resume()thr_continue() 
run()  
setDaemon()

THR_DAEMON flag

 
setName()  
setPriority()thr_setprio()pthread_ setschedparam()
sleep()sleep()sleep()
start()  
stop()  
suspend()  
 Synchronization methods
wait()cond_wait()pthread_cond_wait()
notify()cond_signal()pthread_cond_signal()

synchronized method 

synchronized statements 

mutexes 

pthread_mutexes