Skip Navigation Links | |
Exit Print View | |
Multithreaded Programming Guide Oracle Solaris 11 Express 11/10 |
1. Covering Multithreading Basics
4. Programming with Synchronization Objects
5. Programming With the Solaris Software
6. Programming With Solaris Threads
The Multithreaded Programming Guide describes the multithreaded programming interfaces for POSIX threads and Oracle Solaris threads in the Oracle Solaris Operating System (Oracle Solaris OS). This guide shows application programmers how to create new multithreaded programs and how to add multithreading to existing programs.
Although this guide covers both the POSIX and Oracle Solaris threads interfaces, most topics assume a POSIX threads interest. Information applying to only Oracle Solaris threads is covered in Chapter 6, Programming With Solaris Threads. The two sets of interfaces share a common implementation and are fully compatible with one another. Calls to POSIX threads interfaces can be freely intermixed with calls to Oracle Solaris threads interfaces.
POSIX threads information can be found in the Single UNIX Specification Version 3 at http://www.opengroup.org/.
Note - This Oracle Solaris release supports systems that use the SPARC and x86 families of processor architectures: UltraSPARC, SPARC64, AMD64, Pentium, and Xeon EM64T. The supported systems appear in the Oracle Solaris 10 Hardware Compatibility List at http://www.sun.com/bigadmin/hcl. This document cites any implementation differences between the platform types.
In this document the term “x86” refers to 64-bit and 32-bit systems manufactured using processors compatible with the AMD64 or Intel Xeon/Pentium product families. For supported systems, see the Oracle Solaris 10 Hardware Compatibility List.
This guide is for application developers who want to create new multithreaded programs or add multithreading to existing programs.
Developers that use this book should be familiar with and be able to use the following technologies:
A UNIX SVR4 system - preferably the current Solaris release.
The C programming language - multithreading interfaces are provided by the standard C library.
The principles of concurrent or parallel programming (as opposed to sequential programming).
Chapter 1, Covering Multithreading Basics gives a structural overview of threads implementation in this release.
Chapter 2, Basic Threads Programming discusses the general POSIX threads routines, emphasizing creating a thread with default attributes.
Chapter 3, Thread Attributes covers creating a thread with nondefault attributes.
Chapter 4, Programming with Synchronization Objects covers the threads synchronization routines.
Chapter 5, Programming With the Solaris Software discusses changes to the operating environment to support multithreading.
Chapter 6, Programming With Solaris Threads covers the Solaris threads (as opposed to POSIX threads) interfaces.
Chapter 7, Safe and Unsafe Interfaces covers multithreading safety issues.
Chapter 8, Compiling and Debugging covers the basics of compiling and debugging multithreaded applications.
Chapter 9, Programming Guidelines discusses issues that affect programmers writing multithreaded applications.
Appendix A, Extended Example: A Thread Pool Implementation shows how to implement a pool of worker threads.
Third-party URLs are referenced in this document and provide additional, related information.
Note - Sun is not responsible for the availability of third-party web sites mentioned in this document. Sun does not endorse and is not responsible or liable for any content, advertising, products, or other materials that are available on or through such sites or resources. Sun will not be responsible or liable for any actual or alleged damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods, or services that are available on or through such sites or resources.
The Sun web site provides information about the following additional resources:
Multithreading requires a different way of thinking about function interactions. The following books are recommended reading.
Concurrent Programming by Alan Burns & Geoff Davies (Addison-Wesley, 1993)
Distributed Algorithms and Protocols by Michel Raynal (Wiley, 1988)
Operating System Concepts by Silberschatz, Peterson, & Galvin (Addison-Wesley, 1991)
Principles of Concurrent Programming by M. Ben-Ari (Prentice-Hall, 1982)
Programming with Threads by Steve Kleiman, Devang Shah, & Bart Smaalders (Prentice Hall, 1996)
Programming with POSIX Threads by David R. Butenhof (Addison-Wesley Professional, 1997)
The following table describes the typographic changes used in this book.
Table P-1 Typographic Conventions
|
The following table shows the default system prompt and superuser prompt for the C shell, Bourne shell, and Korn shell.
Table P-2 Shell Prompts
|