Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
Pthreads programming
Nichols B., Buttlar D., Farrell J., O’Reilly & Associates, Inc., Sebastopol, CA, 1996. Type: Book (9781565921153)
Date Reviewed: Oct 1 1997

Threaded programming styles have been widely adopted in the 1990s. This is true not only for Windows NT, but also for the mainstream of Unix, including System V Release 4, Solaris, and OSF 1. Threads are a general concept for exploiting the potential parallelism present in many applications with as little operating system overhead as possible. Pthreads is a standardized model, in which the “P” derives from POSIX, the IEEE family of operating system interface standards. The Pthreads model is made up of a defined set of C types and calls; implementations are usually available in the form of a header file and a linkable library.

Starting in chapter 1 with a discussion of multithreading as a means of speeding up programs, readers are introduced to the basic structure that identifies a thread. Compared to a full-blown process, a thread may be viewed as a locus of control consisting of only the machine registers (program counter, stack pointer, and so on), with none of the other parts of the virtual address space of the creating process (its program text, global data, and heap) and none of the creator’s identity or resources. Synchronization and communication issues are also highlighted in chapter 1. Chapter 2 looks at the design of threaded programs by representing three types of distributing work: the boss/worker, peer, and pipeline models. Threads may be created on demand or via thread pools. An automatic teller machine server is introduced and is used as an example throughout the book. Synchronization issues are dealt with in chapter 3. Here we find tools for mutual exclusion and conditional critical sections as well as composite protocols such as reader/writer locks. More advanced management features, such as privacy keys, asynchronous termination (cancellation), and persistence, are relegated to chapter 4, which explains how thread scheduling policies and priorities may be controlled.

The interaction of a multithreaded program with various features of Unix is described in chapter 5. In addition to the question of what Unix signals and Unix fork and exec calls do to threads, this chapter covers the problems of interaction between the Pthreads library and system calls and libraries to control concurrent usage by multiple threads from the same process. Finally, chapter 6 presents further practical considerations, especially the issues of speed and debugging. The authors discuss the three basic strategies of Pthreads implementations--pure user space, pure kernel space, and hybrids (such as lightweight processes and two-level scheduler implementations)--from a performance point of view. The Pthreads standard does not offer any specific support for debugging. Such support must be expected from any commercial platform. Thread overhead, the costs of sharing too much, and good locking strategies are practical considerations for every thread programmer. Several performance comparisons are given, ending the book on an encouraging note. There is a large body of scientific knowledge supporting this programming style.

The first of three appendices deals with Pthreads and OSF’s Distributed Computing Environment, the second discusses differences between Draft 4 and Draft 10 of the Standard, and the third gives a quick reference to the syntax of any Pthreads library call. The examples used in this fun-to-read introductory reference book are available in electronic form. This book is organized lucidly and efficiently, the writing is congenial, and the accompanying material is complete. I highly recommend it.

Reviewer:  A. B. Cremers Review #: CR120703 (9710-0745)
Bookmark and Share
 
Multiprocessing/ Multiprogramming/ Multitasking (D.4.1 ... )
 
 
Posix (D.4.9 ... )
 
Would you recommend this review?
yes
no
Other reviews under "Multiprocessing/Multiprogramming/Multitasking": Date
Algorithms for scheduling homogeneous multiprocessor computers
Ondáš J., Springer-Verlag, London, UK, 1984. Type: Book (9789780387136578)
Aug 1 1985
Parallel programming
Perrott R., Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 1987. Type: Book (9789780201142310)
Jul 1 1988
Operating systems: communicating with and controlling the computer
Keller L., Prentice-Hall, Inc., Upper Saddle River, NJ, 1988. Type: Book (9789780136380405)
Sep 1 1989
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy