![[Book Cover]](../covergif/0136807291.gif)
|
Multithreaded Programming With PThreads, 1/e
Bil Lewis, SunSoft, Inc.Menlo Park, California
Daniel J. Berg, Houston, Texas
Sun Microsystems Press, Palo Alto, CA
Published December, 1997 by Prentice Hall PTR (ECS Professional)
Copyright 1998, 432 pp.
Paper
ISBN 0-13-680729-1
|
Sign up for future mailings on this subject.
See other books about:
Operating Systems--Advanced-Computer Science
|

The books aim is to give the programmer a solid, basic understanding
of threads what they are, how they work, why they work, why
they are useful, and some of the programming issues surrounding their
use. A reader should come away with a solid understanding of the fundamentals
of multithreading, being able to write credible, modestly complex,
threaded programs.
Focuses on the POSIX multithreading model, making comparisons
to OS/2 and Win32 throughout.
- Contrasting POSIX API to the OS/2 and Win32 APIs gives
the programmer a feeling for what kind of porting issues might be
involved when writing to more than one of these libraries.
Promotes MT programming as a means for writing better programs
more easily, and for having programs that run faster with fewer bugs.
Provides an introduction to the underlying structures upon
which threads are built, the construction of the threads themselves,
and the operating system support that allows efficient implementation.
Details the different scheduling models and the various
alternative choices that could be made.
- Describes context switching in detail.
- Delves into the details of the various POSIX options
and parameters.
Discusses hardware cache architectures, interconnect
topologies, atomic instructions, invalidation techniques.
Includes several complete programs which are presented as
examples.
- Details and issues of the threads used are discussed.
- References to other programs on the net are made.
Covers the cancellation of unwanted threads.
1. Introduction.
2. Concepts.
Background: Traditional Operating Systems. What Is a Thread?
Kernel Interaction. The Value of Using Threads. What Kind of Programs
to Thread? What About Shared Memory? Threads Standards. Performance.
3. Foundations.
Implementation vs. Specification. Thread Libraries. The
Process Structure. Lightweight Processes. Solaris Multithreaded Model.
System Calls. Signals.
4. Lifecycle.
5. Scheduling.
Different Models of Kernel Scheduling. Thread Scheduling.
Context Switching. When Should You Care About Scheduling?
6. Synchronization.
Synchronization Issues. Synchronization Variables. A Stoppable
Producer/Consumer Example.
7. Complexities.
Complex Locking Primitives. Other Synchronization Variables.
Message Queues. Cross-Process Synchronization Variables. Initialization
and Destruction. Synchronization Problems.
8. TSD.
Thread-Specific Data. Global Variables, Constants, and Cheating.
9. Cancellation.
What Cancellation Is. A Cancellation Example. Using Cancellation.
Cancellation Safety. Simple Polling.
10. Signals.
Signals in UNIX. The Solaris Implementation of Signal Handling.
Don't Use Signal Handlers!
11. Details.
Attribute Objects. POSIX Thread Ids. Win32 Thread IDs and
Thread Handles. Initializing Your Data: pthread_once(). POSIX Namespace
Restrictions. Return Values and Error Reporting. Constants Comments.
Pthread Futures. Pthread Extensions. Comparing the OS/2, Win32, and
POSIX Libraries.
12. Libraries.
The Threads Library. Multithreaded Kernels. Are Libraries
Safe? Stub Functions in libc. New Semantics for System Calls. Are
Libraries Safe? Threads Debugger Interface. Mixing Solaris Pthreads
and UI Threads. Comparisons of Different Implementations.
13. Design.
Making Libraries Safe and Hot. Manipulating Lists. Program
Design.
14. Languages.
C. C++. Java. Fortran. Ada. Pascal. Smalltalk. Lisp. Eiffel.
Commercial Products. Public Pthreads Implementations.
15. Tools.
Static Lock Analyzer. Using a Thread-Aware, Graphical Debugger.
Debug Mutexes. Protocol. TNFview.
16. Performance.
Optimization: Objectives and Objections. CPU Time, I/O Time,
Contention, Etc. Limits on Speedup. Benchmarks and Repeatable Testing.
The Lessons of NFS.
17. Hardware.
Types of Multiprocessors. Bus Architectures. Memory Systems.
18. Examples.
Threads and Windows. Socket Server (Master/Slave Version).
Socket Server (Producer/Consumer Version). Other Programs on the Web.
Appendix A. Internet.
Threads Newsgroup. Code Examples. Vendor's Threads Pages.
Threads Research. The SPILT Package for UI/POSIX Compatibility. Freeware
Tools. Other Pointers. The Authors on the Net.
Appendix B. Books.
Threads Books. Related Books.
Appendix C. Timings.
Appendix D. Mistakes.
Appendix E. APIs.
Function Descriptions. Pthread Functions. Pthread Attributes
Objects. POSIX Realtime Scheduling. Mutexes. Mutex Attributes Objects.
Condition Variables. Condition Variable Attributes Objects. Cancellation
Functions. Thread-Specific Data Functions. Semaphores. Signal Functions.
Stdio.
Glossary.
Index.
|