![[Book Cover]](../covergif/0134436989.gif)
|
Threads Primer: A Guide to Multithreaded Programming, 1/e
Bil Lewis, Menlo Park, California
Daniel J. Berg, Houston, Texas
Published October, 1995 by Prentice Hall PTR (ECS Professional)
Copyright 1996, 352 pp.
Paper
ISBN 0-13-443698-9
$42.00
|
Sign up for future mailings on this subject.
See other books about:
System Programming
![[Preface]](../images/cat_preface.gif)
"Click here to see foreign versions available for this book"
|
Providing an overview of the Solaris and POSIX multithreading architectures, this book explains threads at a level that is completely accessible to programmers and system architects with no previous knowledge of threads.
Covers the business and technical benefits of threaded programs, along with discussions of third party software that is threaded, pointing out the benefits.
Acknowledgments. Preface.
1. Introduction.
2. Concepts.
Background: Traditional Operating Systems. What Is a Thread? Kernel
Interaction. System Calls. Signals. Synchronization. Scheduling. The Value of
Using Threads. Parallelism. Throughput. Responsiveness. Communications.
System Resources. Distributed Objects. Same Binary for Uniprocessors and
Multiprocessors. Program Structure. Single Source for Multiple Platforms.
What Kind of Programs to Thread? Inherently MT Programs. Not Obviously MT
Programs. Automatic Threading. Programs Not to Thread. What About Shared
Memory? Threads Standards. Performance. Solaris 2. NFS. SPECfp. PAR93.
Dakota Scientific Software, Inc.. MARC Analysis Inc.. Delphax and Uniq Inc.
Adobe. Facet Decision Systems, Inc.. The ImagiNation Network. Visual
Numerics. Vantage Analysis Systems, A Viewlogic Company. Landmark Graphics.
University of Houston. Geophysical Development Corporation. InfoGraphix.
Technologies Incorporated. Scitex. Western Geographical.
3. Foundations.
Implementation vs. Specification. Thread Libraries. The Process
Structure. Lightweight Processes. Threads and LWPs. Solaris Multithreaded
Model. System Calls. Signals. Don't Use Signal Handlers! Per-Thread Timers.
4. Scheduling.
Different Models of Kernel Scheduling. Threads Are Not Always User-
level Entities. Thread Scheduling. Thread Scheduling Details. Context
Switching. Preemption. How Many LWPs? Bound Threads and Real-time LWPs.
Binding LWPs to Processors. When Should You Care About Scheduling? Thread
Creation and Destruction. Returning Status and Memory. That's Not a Bug,
That's a Feature! Exiting the Process. Cancellation.
5. Synchronization.
Synchronization Issues. Memory Model. Critical Sections. Lock Your
Global Variables! Synchronization Variables. Mutexes. Reader/Writer Locks.
Condition Variables. Semaphores. Barriers. Event Semaphores. OS/2 Critical
Sections. Spin Locks. Adaptive Locks. Cross-process Synchronization
Variables. Synchronization Variable Initialization and Destruction.
Synchronization Problems. Deadlocks. Race Conditions. Recovering from
Deadlocks. Priority Inversion. FIFO Mutexes. Thread-specific Data. Thread
Local Storage. Global Variables, Constants, and Cheating. Comparing the Four
Libraries.
6. Operating System Issues.
The Solaris Threads Library. Solaris Multithreaded Kernel.
Concurrency vs. Parallelism. Solaris Symmetric Multiprocessing. Kernel
Scheduling. Are Libraries Safe? Async Safety. New Semantics for System Calls.
Forking New Processes. Executing a New Program. The New System Call
sigwait(2). The Solaris Operating Environment. SVR4 and SPEC 1170 Compliant.
Real-Time, Fully Preemptable Kernel. SMP. Dynamically Loadable Kernel
Modules. Auto-Configuration. Dynamically Loadable, Shared Memory Modules.
Memory-Mapped Files. Optimized Swap Space. Transport-Layer Interfaces. Cache
File System and Auto File System. Interactive Scheduling Class. In-kernel
rlogin/telnet. Wabi and MAE. Network Information Service Plus. CDE. Project
DOE. Multiple Hardware Architectures. Solaris Threads Debugging Interface.
Comparisons of Different Implementations.
7. POSIX Threads (pthreads).
Pthreads Introduction. Attribute Objects. Threads and Attribute
Objects. Synchronization Variables and Attribute Objects. Cancellation.
Thread Scheduling. Moving Between the Two APIs.
8. Programming Tools.
LockLint. LoopTool. SPARCworks Debugger. Thread Analyzer. Examples
of Using the Tools. Example One: Threading the Mandelbrot Program. Example
Two: Checking a Program with LockLint. Example Three: Parallelizing Loops
with LoopTool. Example Four: Using the SPARCworks Debugger. For More
Information.
9. Programming With Threads.
Global Variables (errno). Static Local Variables. Synchronizing
Threads. Single-Lock Strategy. Reentrance. Avoiding Deadlock. Scheduling
Problems. Locking Guidelines. Following Some Basic Guidelines. Creating
Threads. Thread Concurrency. Bound Threads.
10. Examples.
Using thr_create() and thr_join(). Producer/Consumer. Matrix
Multiplication. Threads and Windows. Socket Server. Using Many Threads. Real-
time Thread. POSIX Cancellation. Deadlock. Software Race Condition. Signal
Handler. Interprocess Synchronization. Arrays.
Appendices.
A. Answers. B. Solaris Signal Implementation. C. Threads on the
Net. Threads on the World Wide Web. The SPILT Package for Solaris/POSIX
Compatibility. Threads Newsgroup. Code Examples. The Authors on the Net. D.
Timings. E. Common Bugs. Failure to Check Return Values for Errors. Using
errno Without Checking the Return Value. Not Joining on Nondetached Threads.
Failure to Verify that Library Calls Are MT Safe. Insufficient Swap Space.
Creating Excessive LWPs. Forgetting to Include the -D_REENTRANT Flag. Using
Spin Locks. Depending upon Scheduling Order. Using errno for Threads Library
Functions. Not Recognizing Shared Data. F. Compile and Debug Specifics.
Compiling a Multithreaded Application. Using libthread. Debugging
Multithreaded Programs. Using adb. Using dbx. G. Application Program
Interface. Condition Functions. Mutex Functions. Reader/Writer Lock
Functions. Semaphore Functions. Thread Functions. H. Pthreads API (POSIX
1003.1c). Condition Functions. Condition Attribute Functions. Mutex
Functions. Mutex Attribute Functions. Pthread Functions. Pthread Attribute
Functions. Semaphore Functions.
Glossary.
Index.
|