Multithreaded Programming Guide

Major API Differences

Solaris threads and pthreads are very similar in both API action and syntax. The major differences are listed in Table 9-1.

Table 9-1 Unique Solaris Threads and pthreads Features

Solaris Threads (libthread) 

POSIX Threads (libpthread) 

thr_ prefix for threads function names; sema_ prefix for semaphore function names

pthread_ prefix for pthreads function names; sem_ prefix for semaphore function names

Readers/Writer locks 

Attribute objects (these replace many Solaris arguments or flags with pointers to pthreads attribute objects) 

Ability to create "daemon" threads 

Cancellation semantics 

Suspending and continuing a thread 

Scheduling policies 

Setting concurrency (requesting a new LWP): determining concurrency level