1. Covering Multithreading Basics
4. Programming with Synchronization Objects
5. Programming With the Solaris Software
6. Programming With Solaris Threads
Compiling a Multithreaded Application
Choosing Solaris or POSIX Threads
Including <thread.h> or <pthread.h>
Compiling and Linking a Multithreaded Program
Compiling and Linking in the POSIX Threads Environment
Compiling and Linking in the Solaris Threads Environment
Compiling and Linking in a Mixed Threads Environment
Linking With -lrt for POSIX Semaphores
Debugging a Multithreaded Program
Common Oversights in Multithreaded Programs
Tracing and Debugging with DTrace
Profiling with Performance Analyzer
Detecting Data Races and Deadlocks Using Thread Analyzer
Tracing and Debugging With the TNF Utilities
To build software on the Solaris OS, you must install the tools you need on your development machine. Whether you want to use the standard tools that are bundled in Solaris OS, or use the Sun Studio tools, you must first install the appropriate Solaris software for a developer environment. If you are using a Solaris Express Developer Edition release, the developer environment is installed by default.
For Solaris 10 releases, the Solaris OS includes a number of developer software packages, which are available when you install the appropriate Solaris software group for developers. For installation purposes, the Solaris OS is logically divided into software groups, which are collections of Solaris packages.
When you install the Solaris OS, you must select one of the following software groups, which contain the developer packages:
Developer
Entire
Entire Plus OEM
With these software groups, you get compilers such as the GNU C compiler (gcc) and the Java compiler (javac). Also installed are the GNU source-level debugger (gdb) and the Modular Debugger (mdb), a linker (ld), source control utilities (sccs), and build utilities such as make. The files are installed in /usr/css and /usr/sfw.
Note - This manual describes building a multithreaded application using the Sun Studio C compiler. The Sun Studio software is included in the Solaris Express Developer Edition release. If you are using a Solaris 10 release, you can download the Sun Studio software from the http://developers.sun.com/sunstudio/ web site.