Truck Month Best Books of the Month Shop Women's Maxi Dresses Shop Women's Maxi Dresses Shop Women's Cloud Drive Photos nav_sap_cbcc_6_fly_beacon Blur Amazon Fire Phone, now available unlocked Amazon Fire TV Beauty Sale Mother's Day Gifts in Home and Kitchen Shop all services Learn More Fifty Shades of Grey Fifty Shades of Grey Fifty Shades of Grey $25 Off Fire HD 6 Kids Edition Kindle Paperwhite Today's Deals in Music Spring Running Event Star Wars Store
Buy Used
$0.39
+ $3.99 shipping
Used: Good | Details
Condition: Used: Good
Comment: Shows some signs of wear, and may have some markings on the inside. 100% Money Back Guarantee. Shipped to over one million happy customers. Your purchase benefits world literacy!
Have one to sell? Sell on Amazon
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

Thread Time: The MultiThreaded Programming Guide Paperback – November 1, 1996


See all formats and editions Hide other formats and editions
Amazon Price New from Used from
Paperback
"Please retry"
$55.11 $0.39

Half-Life by Frank Close
Half-Life by Frank Close
Check out the newest book by Frank Close. Learn more | See related books
NO_CONTENT_IN_FEATURE

Shop the new tech.book(store)
New! Introducing the tech.book(store), a hub for Software Developers and Architects, Networking Administrators, TPMs, and other technology professionals to find highly-rated and highly-relevant career resources. Shop books on programming and big data, or read this week's blog posts by authors and thought-leaders in the tech industry. > Shop now

Product Details

  • Series: Hewlett-Packard Professional Books
  • Paperback: 560 pages
  • Publisher: Prentice Hall PTR (November 1, 1996)
  • Language: English
  • ISBN-10: 0131900676
  • ISBN-13: 978-0131900677
  • Product Dimensions: 9.2 x 7 x 0.9 inches
  • Shipping Weight: 1.8 pounds
  • Average Customer Review: 3.8 out of 5 stars  See all reviews (4 customer reviews)
  • Amazon Best Sellers Rank: #1,811,531 in Books (See Top 100 in Books)
  •  Would you like to update product info, give feedback on images, or tell us about a lower price?


Editorial Reviews

From the Publisher

Understand multithreading, the next dimension in high-performance computing. Thread Time is the easiest programmer's guide to the important new multi-threading techniques that are increasingly important in Windows NT/95, UNIX, POSIX, and other application development. Each concept in the book is illustrated with a picture, making this an exceptionally easy-to-understand book. The book introduces the process model, the thread model, and basic thread management functions. Learn how to synchronize and schedule threads. In a Programming Guidelines chapter, learn the basic do's and don'ts of multithreaded programming. The book includes extensive examples, exercises and references, including manual pages, debugging advice, and a CD-ROM loaded with practical information. This book is an effective introduction to multithreading for both professional programmers and students.

From the Inside Flap

PREFACE

Although threads have been around for decades, the use of threads on UNIXâ systems only started to become popular in the early 1990s. During this time, multiprocessor systems, client/server applications, and graphical user interfaces (GUIs) were making their way into the UNIX mainstream. Into this new era for UNIX, threads brought many benefits, but the most important was (and still is) performance. A multithreaded program can achieve significant performance gains through concurrent and/or parallel thread execution.
Concurrent thread execution means that two or more threads are in progress at the same time. If one thread blocks for some reason, another thread from the same program can execute in its place. This feature is especially relevant for cli- ent/server, GUI-based, and general I/O-bound applications. Parallelism occurs when two or more threads execute simultaneously across multiple processors. Parallelism exploits the processing power of multiprocessor systems and is espe- cially useful for compute-bound applications. Yet, threads are not a panacea. For example, thread management carries with it a certain amount of overhead. Thus, in order for a program to achieve a net performance gain, the concurrency or parallelism benefit must outweigh the thread management overhead liability. Fortunately, many applications can use threads to achieve significant perfor- mance gains.
This book teaches the application of multithreaded programming with the instruction, examples, and reference material needed to exploit this important software technology. Thread Time is primarily designed to be a practical guide for programming with POSIX.1c threads (also known as Pthreads). The Pthreads interfaces are presented and explained in detail. Code examples are provided, both in this book and on CD-ROM, that show how the interfaces are used. Guidelines teach you when to use threads, how to use them, how to avoid problems, and how to solve problems when they arise.
Thread Time may be suitable as a textbook in an advanced undergraduate or first-year graduate computer science curriculum. Clear objectives are provided at the beginning of each chapter, and exercises that help reinforce your knowl- edge of the technology are provided at the end of each chapter. The code exam- ples in this book are written in the C programming language.

Chapter Organization and Descriptions.
Although this has not been done explicitly, this book can be divided into five parts: Foundational Information, Pthreads Interfaces and Their Use, Program- ming with Threads, Advanced Topics, and Reference Material. Depending on your needs, you may wish to skip to a particular part or chapter.

1. Foundational Information.
Chapter 1: The Process Model chapter provides a foundation for understand- ing the benefits of threads. Herein, we present an overview of two areas: (1) the single-threaded process and (2) the process management portion of the UNIX operating system. At the end of this chapter, we draw a few conclusions about the limitations of single-threaded programming. Definitions for the Process Model, a process, and a thread are found in this chapter.
Chapter 2: The Thread Model chapter builds a foundation for programming with threads. Presented are several attributes of programs suitable for threads, several benefits of threads, and a high-level overview of three Thread Model operating systems. A number of essential definitions and concepts are provided in this chapter.
Chapter 3: The Introduction to POSIX chapter provides a brief introduction to the structure of POSIX and teaches you how to verify which POSIX thread functionality is supported on your system.
2. Pthreads Interfaces and Their Use.
Chapter 4: This chapter presents the Basic Thread Management interfaces and explains how they are used. These interfaces allow you to create, terminate, and synchronize threads. Specialized attributes are also available for creating threads with unique characteristics.
Chapter 5: The programmer assumes more responsibility when programming with threads. Thread operations must occur in the correct order, access to shared objects must be coordinated, and all threads must work together to achieve the desired result. Several mechanisms are available to coordinate, or synchronize, threads within a program. The Thread Synchronization chapter explains how to use these mechanisms.
Chapter 6: To accommodate varying needs, the scheduling policy and priority of POSIX.1c threads can be programmatically controlled. This chapter presents the Thread Scheduling interfaces, explains how they are used, and describes how threads compete for processor time.
Chapter 7: When a single-threaded process receives a signal, the default action is to terminate the process unless a signal handler has been installed. If a signal handler is invoked, program execution is interrupted. In a multithreaded pro- gram, signal handling is more flexible. A signal can be handled by a single thread within the program, allowing other threads to continue execution. The Threads and Signals chapter presents the Pthreads signal interfaces and explains how they are used.
Chapter 8: When programming with threads, it is often necessary to terminate a thread within the application. Signals appear to provide the most logical means to accomplish thread termination. However, signals have two major draw- backs: (1) if a signal causes a thread to terminate, the entire process terminates and (2) if POSIX allowed a signal to cause thread termination (and not process termination), mutexes and other resources acquired by terminated threads would never be released. The latter case could lead to deadlock. This chapter pre- sents the Thread Cancellation interfaces, explains the concept of thread can- cellation, and explains how resources are released when a thread is canceled.
Chapter 9: When a multithreaded program is written, a determination must be made as to how global data will be shared among the threads in the process. There are two choices: (1) a global data variable can be process shared and pro- tected with synchronization primitives; or (2) a global data variable can be spe- cific to each thread. In the second case, Thread-Specific Data is employed and synchronization is not required. This chapter presents the thread-specific data interfaces and explains how they are used.
Chapter 10: The HP-UX system includes several Thread Extensions, such as read-write locks, enhanced MxN Model scheduling control, processor affinity, and additional mutex types. Many of these features are thread extensions pro- vided by the X/Open Portability Guide. Some of these features are provided only by Hewlett-Packard and may not be portable. Nevertheless, all of these are pow- erful features that can enhance multithreaded programs.
Chapter 11: The Thread F/X (Effects) chapter discusses the behavior of com- mon library functions when they are used in multithreaded programs. For exam- ple, what happens when a thread calls fork? If a thread locks a file, will other threads in the same program still have access? Are there performance or porta- bility considerations when common library functions are used in multithreaded programs? Questions such as these are answered in this chapter.
3. Programming with Threads.
Chapter 12: The Writing Thread-Safe Code chapter defines thread-safing terminology and then describes several important facets of writing thread-safe code. At the end of this chapter, we provide a preflight checklist for designing thread-safe libraries.
Chapter 13: The Programming Guidelines chapter provides specific guide- lines for programming with threads based upon the information presented in the previous chapters. These guidelines include best practices, performance and portability tips, and constructs to avoid.
Chapter 14: You have written your multithreaded application. It compiles. However, when running the application, you notice some unexpected behavior. Perhaps a value from a calculation is incorrect, I/O is interleaved, or perfor- mance is poor. Alternatively, you may notice that certain tasks are incomplete or maybe the entire program hangs. The Debugging Threaded Applications chapter presents symptoms, probable causes, and possible solutions for you to consider during your systematic debugging process.
4. Advanced Topics.
Chapter 15: The Parallel Programming Models and Issues chapter dis- cusses several software models suitable for multithreaded programs. Some mod- els are suitable for I/O-bound applications; others are suitable for compute- bound applications. The former exploit the concurrency benefit whereas the lat- ter uses parallelism to exploit the power of multiprocessor systems. A discussion of parallel programming issues follows. Several important issues relating to thread creation, thread synchronization, and multiprocessor cache thrashing are identified. Specific techniques, guidelines, and solutions are also presented.
5. Reference Material.
Appendix A: The Pthread Manual Pages in this appendix come directly from Hewlett-Packard's HP-UX Release 10.30. They appear in this book exactly as they appear on-line. Many thanks to Hewlett-Packard for allowing us to publish these manual pages.
Appendix B: Glossary.
Appendix C: Bibliography.

Conventions Used in this Book.
1. Chapters.
To assist in rapid learning and to provide ease of use, information in this book is presented in modular form. Chapters are divided into sections; each section cov- ers a particular topic. A section is composed of a title, descriptive picture, synoptic caption, full text explanation, and guidelines or code examples as appropriate. Here is a simplified example of a section:
Protecting Shared Objects.
Fig. 3-7 Use a mutex to serialize access to a shared object. If a piece of shared data will never be modified, a mutex is not needed.
A mutex is a mutual exclusion object that is used to serialize access to shared objects. Once a thread locks a mutex, other threads wishing to gain access to the shared object block until the mutex is unlocked.
Not all shared objects require protection. For example, if a piece of shared data will never be modified, there is no need to protect that data with a mutex.
Guidelines.
* decide which shared objects require serial access
* use one mutex for each shared object requiring
serial access
Example

pthread_mutex_t m;

pthread_mutex_lock(&m);

pthread_mutex_unlock(&m);


The title of each section is given in the “Topics Covered” portion of each chap- ter introduction. Sections are presented in the same order listed. The last section in each chapter is followed by a chapter summary and exercises.
2. Use of Fonts.
Bold is used to indicate great importance.
Italics is used for definition of terms, emphasis, function arguments, or ref- erences to chapters (e.g., see Chapter 5, Thread Synchronization).
Courier is used for function names e.g., pthread_create() and for code examples.
Bold courier is used for macros and definitions referenced in the text.
CD-ROM and Code Examples
This book contains numerous code examples. To provide focus, many examples omit included files, declarations, and error checking. The CD-ROM packaged with Thread Time contains full, working versions of all code examples presented herein. In addition, templates are provided for several parallel programming models.
The CD-ROM has been formatted in the ISO 9660 and Rock Ridge file system formats. These formats are suitable for use on most operating system platforms. To access the code examples, mount the CD-ROM as a file system. The examples should then be copied to your local file system so that they may be compiled and/ or manipulated.

Acknowledgments.
We're indebted to the following individuals who performed a full review of the technical material contained herein: Greg Astfalk, Bruce Blinn, Wayne A. Booth, Tom Doeppner, Edith Epstein, Duncan Missimer, Ann Schneider, Richard Mar- lon Stein, Tom Watson, and Joel Williamson. Their valuable feedback has gone a long way to improve the quality of this book. Special thanks to Ann Schneider for reviewing and editing the manuscript many times and answering countless edit- ing questions at all hours of the night. We would also like to thank Tony Coon, Marti Jones, Doug McKenzie, and Anil Rao for their constructive technical and editorial comments.
We would especially like to thank our families, Ann, Amy, and Ann, for their sup- port, patience, and encouragement throughout the writing of this book.

Important Information

Ingredients
Example Ingredients

Directions
Example Directions

Customer Reviews

3.8 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

5 of 5 people found the following review helpful By A Customer on January 3, 1998
Format: Paperback
Best book I've seen on the subject of POSIX thread programming. My only criticism is that the examples are lame. They excercise the API calls described in the preceeding text without adding any helpful context, insight, or details.
The author would have done better to provide one or two fairly complex case studies as examples, with analysis of their design process and tradeoffs. Instead there are small examples of every little detail of the API, that they add nothing of value to the book.
That criticism aside, it is a well-written, useful book, which I highly recommend.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
By Armando Fonseca on December 22, 2010
Format: Paperback Verified Purchase
Pro:
An easy-to-read book meant for practitioners without missing basic multi-threading concepts.
Cons:
- I think they use some sort of scanner that treat tabs and spaces differently; Nothing wrong with that, is just that the code looks messy.
- While the book can be apply to any posix environment, the author was a little bit too comfortable with HP-Unix, again nothing wrong with that, but choosing an agnostic approach could it be the choice for a non-OS MT book.
- Several code examples didn't compile mostly by syntax errors... Not a big deal, but I didn't enjoy extra minutes/hours trying to find the problem of the code.
- Source code files are not standalone examples. I don't mind a code example using code from another file but the files aren't organized and their names aren't trivial so you have to do a brute-force look to each file until you find the code that your example is using.

Overall, even though, I only have one pro, I would recommend this book because I learned a lot from it and it is easy to read. While not a holy-grail, this are one of those that I wish I could it have this book in my undergrad years.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
1 of 2 people found the following review helpful By A Customer on December 25, 1997
Format: Paperback
This seems to be the only good book I have come across on the basics of thread programming. Focused on POSIX, comparison is provided between process and threads, which slowly but surely convinces the
reader the significance of using threads and also, when to use them.
Finally, the best feature I liked was that each topic is discussed and then the use is
illustrated by a small independent program (sometimes 'extern' functions have been used which might require use
of a previous source code).
Overall, best book I have come across for getting introduced to thread programming. If there are even better ones (
beginners level) I am interested to know.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again
By W. Ewien on May 14, 2014
Format: Paperback
good product, like it.
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

What Other Items Do Customers Buy After Viewing This Item?