Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
     Contents   Next 
   
 

Preface

The Multithreaded Programming Guide describes the multithreaded programming interfaces for POSIX and Solaris threads in the Solaris™ Operating Environment. 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 Solaris threads implementations, most topics assume a POSIX threads interest. Information applying to only Solaris threads is covered in a special chapter.

To understand this guide, a reader must be familiar with

  • A UNIX® SVR4 system--preferably the Solaris Operating Environment.

  • The C programming language--multithreading is implemented through the libthread library

  • The principles of concurrent programming (as opposed to sequential programming)--multithreading requires a different way of thinking about function interactions. Some books you might want to read are:

    • Algorithms for Mutual Exclusion by Michel Raynal (MIT Press, 1986)

    • 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)

How This Guide Is Organized

Chapter 1 gives a structural overview of threads implementation in this release.

Chapter 2 discusses the general POSIX threads library routines, emphasizing creating a thread with default attributes.

Chapter 3 covers creating a thread with nondefault attributes.

Chapter 4 covers the threads library synchronization routines.

Chapter 5 discusses changes to the operating environment to support multithreading.

Chapter 6 covers multithreading safety issues.

Chapter 7 covers the basics of compiling and debugging multithreaded applications.

Chapter 8 covers the Solaris threads (as opposed to POSIX threads) interfaces.

Chapter 9 discusses issues that affect programmers writing multithreaded applications.

Appendix A shows how code can be designed for POSIX threads.

Appendix B shows an example of building a barrier in Solaris threads.

Accessing Sun Documentation Online

The docs.sun.comSM Web site enables you to access Sun technical documentation online. You can browse the docs.sun.com archive or search for a specific book title or subject. The URL is http://docs.sun.com.

What Typographic Conventions Mean

The following table describes the typographic changes used in this book.

Table P-1 Typographic Conventions

Typeface or Symbol

Meaning

Example

AaBbCc123

The names of commands, files, and directories; on-screen computer output 

Edit your .login file.

Use ls -a to list all files.

machine_name% you have mail.

AaBbCc123

What you type, contrasted with on-screen computer output machine_name% su Password:

AaBbCc123

Command-line placeholder: replace with a real name or value 

To delete a file, type rm filename.

AaBbCc123

Book titles, new words, or terms, or words to be emphasized.

Read Chapter 6 in User's Guide.

These are called class options.

You must be root to do this.

 
 
 
     Contents   Next