Java on Solaris 7 Developer's Guide

API Mapping

This 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 only serves to show a loose equivalence between the APIs and some guidance to developers familiar with one API and interested in knowing its relationship to the corresponding API. There is a conceptual difference between using the Solaris APIs by way of procedural and layered programming in C, and using them via 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