JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Multithreaded Programming Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Covering Multithreading Basics

2.  Basic Threads Programming

3.  Thread Attributes

4.  Programming with Synchronization Objects

5.  Programming With the Oracle Solaris Software

Forking Issues in Process Creation

Fork-One Model

Fork-One Safety Problem and Solution

Virtual Forks-vfork

Solution: pthread_atfork

Fork-All Model

Choosing the Right Fork

Process Creation: exec and exit Issues

Timers, Alarms, and Profiling

Timers

Alarms

Profiling a Multithreaded Program

Nonlocal Goto: setjmp and longjmp

Resource Limits

LWPs and Scheduling Classes

Timeshare Scheduling

Realtime Scheduling

Fair Share Scheduling

Fixed Priority Scheduling

Extending Traditional Signals

Synchronous Signals

Asynchronous Signals

Continuation Semantics

Operations on Signals

Setting the Thread's Signal Mask

Sending a Signal to a Specific Thread

Waiting for a Specified Signal

Waiting for Specified Signal Within a Given Time

Thread-Directed Signals

Completion Semantics

Signal Handlers and Async-Signal Safety

Interrupted Waits on Condition Variables

I/O Issues

I/O as a Remote Procedure Call

Tamed Asynchrony

Asynchronous I/O

Asynchronous I/O Operations

Waiting for I/O Operation to Complete

Shared I/O and New I/O System Calls

Alternatives to getc and putc

New System Calls For Reliable Multithreaded Programming

6.  Programming With Oracle Solaris Threads

7.  Safe and Unsafe Interfaces

8.  Compiling and Debugging

9.  Programming Guidelines

A.  Extended Example: A Thread Pool Implementation

Index

Process Creation: exec and exit Issues

Both the exec(2) and exit(2) system calls work as these functions do in single-threaded processes with the following exception. In a multithreaded application, the functions destroy all the threads in the address space. Both calls block until all the execution resources, and so all active threads, are destroyed.

When exec() rebuilds the process, exec() creates a single lightweight process (LWP). The process startup code builds the initial thread. As usual, if the initial thread returns, the thread calls exit() and the process is destroyed.

When all the threads in a process exit, the process exits. A call to any exec() function from a process with more than one thread terminates all threads, and loads and executes the new executable image. No destructor functions are called.