Programming Books C Java PHP Python Learn more Browse Programming Books
Buy Used
FREE Shipping on orders over $35.
Condition: Used: Good
Comment: Previous owner's name blacked out on title page, otherwise clean, unmarked pages throughout. Covers have wear/scratches/scuffs and a small tear on the spine. Also, there is a little peeling on the back cover. A good, solid copy. Shipped to you Directly by Amazon, with A NO HASSLE RETURN POLICY. Your Satisfaction is Guaranteed!
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

Threads Primer: A Guide to Multithreaded Programming Paperback – October 31, 1995

Amazon Price New from Used from
"Please retry"
$52.68 $0.01

Frequently Bought Together

Threads Primer: A Guide to Multithreaded Programming + PThreads Programming: A POSIX Standard for Better Multiprocessing (A Nutshell handbook)
Buy the selected items together


Shop the new
New! Introducing the, 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

  • Paperback: 352 pages
  • Publisher: Prentice Hall PTR; 1 edition (October 31, 1995)
  • Language: English
  • ISBN-10: 0134436989
  • ISBN-13: 978-0134436982
  • Product Dimensions: 9.2 x 7 x 0.6 inches
  • Shipping Weight: 9.6 ounces
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (6 customer reviews)
  • Amazon Best Sellers Rank: #1,476,095 in Books (See Top 100 in Books)

Editorial Reviews

From the Inside Flap

Today, there are three primary sets of multithreading (MT) libraries: the "standards-based" libraries (all of the UNIX® implementations, which will move to POSIX upon ratification), the OS/2® library, and the Windows NT(TM) library.

(The NT and OS/2 libraries are fairly similar, which should not be too surprising. NT did start life as OS/2, version 2, after all.) Although the APIs and implementations differ significantly, the fundamental concepts are the same. The ideas in this book are valid for all three; the details of the APIs differ.

All the specific discussion in this book focuses on the Solaris(TM) 2 and POSIX multithreading models, with comparisons to OS/2 and NT throughout. We concentrate on the Solaris implementation in greatest detail. We do so because the Solaris threads library is currently the most advanced and robust implementation available, has the maximum exposure, the best thread-aware tool suite, and conforms most closely to the POSIX standard. (The fact that we both work for Sun has nothing to do with it.)

A frank note about our motivation is in order here. We have slaved away for countless hours on this book because we're propeller-heads who honestly believe that this technology is a superb thing and that the widespread use of it will make the world a better place for hackers like ourselves. Sun's motivation for assisting us in the project is to promote the usage of MT, because (a) this means you can write better, faster programs on Solaris, increasing sales of the operating system, and (b) Sun is far ahead of everybody else in both MT and multiprocessor (MP) machines, so it should leverage hardware sales, too.

Your motivations for writing MT programs? You can write your programs better and more easily, they'll run faster, and you'll get them to market more quickly, they'll have fewer bugs, you'll have happier programmers, customers, and higher sales. The only losers in this game are the competitors, who lag behind Sun in MP hardware and MT software and will lag behind you in application speed and quality.

MT is here today. It will soon be ubiquitous. As a professional programmer, you have an obligation to understand this technology. It may or may not be appropriate for your current project, but you must be able to make that conclusion yourself. This book will give you what you need to make that decision.

Welcome to the world of the future!

Who Should Use This Book

This book aims to give the programmer or technical manager a solid, basic understanding of threads-what they are, how they work, why they are useful, and some of the programming issues surrounding their use. As an introductory text, it does not attempt a deep, detailed analysis. After reading this book you should have a solid understanding of the fundamentals, be able to write credible, modestly complex, threaded programs and have the understanding necessary to analyze your own programs and determine the viability of threading them.

This book is written with the experienced C/UNIX programmer in mind. A non-UNIX programmer will find a few of the details unfamiliar, but the concepts clear.

A non-C programmer will find the code fragments and API descriptions mildly challenging, though possible to decipher, while the concepts should be clear. A technically minded nonprogrammer should be able to follow most of the concepts and understand the value of threads. A nontechnical person will not get much from this book.

How This Book Is Organized

Chapter 1, Introduction - In which we present the motivation for creating thread libraries, discuss the advent of shared memory multiprocessors, and the interactions between threads and SMP machines.

Chapter 2, Concepts - In which the reader is introduced to the basic concepts of multitasking operating systems and of multithreading as it compares to other programming paradigms. The reader is shown a set of reasons why multithreading is a valuable addition to programming paradigms, and a number of examples of successful deployment are presented.

Chapter 3, Foundations - In which the reader is introduced to the underlying structures upon which threads are built, the construction of the thread itself, and the operating system support that allows an efficient implementation.

Chapter 4, Scheduling - In which we explain the myriad details of the different scheduling models. After the reader is given a firm grounding in the fundamental concepts, we explain the various alternative choices that could have been made. Finally, the reader is treated to a comprehensive explanation of the intricacies in the life of a thread.

Chapter 5, Synchronization - In which the reader is led on a hunt for the intimidating synchronization variables and discovers that they are not actually as frightening as had been thought. After the hardware and software issues surrounding them are explained, the reader is shown the trade-offs involved in selecting the proper one to use. The chapter concludes with an explanation of thread-specific data.

Chapter 6, Operating System Issues - In which we explore a variety of operating systems issues that bear heavily upon the usability of the threads library in actual programs. We also examine a set of general operating system functions and their value.

Chapter 7, POSIX Threads (pthreads) - In which the details of the POSIX concepts are explained and contrasted to those of Solaris. A brief consideration of the issues of moving from Solaris threads to POSIX threads concludes the chapter.

Chapter 8, Programming Tools - In which we consider the kinds of new tools that a reader would want when writing an MT program. Details of the Solaris tool set are discussed in the context of working with actual programs.

Chapter 9, Programming With Threads - In which some pointers on programming with threads are given. Differences between single- threaded thinking and multithreaded thinking are emphasized.

Chapter 10, Examples - In which several example programs are presented, and their details and issues surrounding the way they use threads are discussed.

Recommended Reading

As of this writing, there are no other books specifically on the topic of multithreading concepts, although we know that several will be coming out within a year of this publication. Many of the operating system books and programming guides contain listings of the APIs but do not attempt to deal with the concepts of MT.

Related Books

Advanced Windows NT: The Developer's Guide to the Win32 Application Programming Interface. Jeffrey Richter. Microsoft Press, 1994. ISBN 1- 55615-567-0. This book contains about 200 pages that cover the NT threads API and its usage. It covers the API well, contains a good amount of code, but very little theory.

Multithreaded Computer Architecture: A Summary of the State of the Art. Edited by Robert A. Iannucci. Kluwer Academic Publishers, 1994. ISBN 0-7923-9477-1. This book is a collection of papers dealing with hardware design considerations for building specialized machines that can support multithreaded programs.

Programming with Threads. Steve Kleiman, Devang Shah, Bart Smaalders. Sun Microsystems Press/Prentice Hall PTR, Publication date late fall 1995. ISBN 0-13-172389-8. This book will be the definitive guide to developing multithreaded programs on UNIX, going into great depth on theory and practice.

Real-World Programming for OS/2 2.1. Derrel R. Blain, Kurt R. Delimon, Jeff English. Sams Publishing/Prentice Hall PTR, 1993. ISBN 0-672- 30300-0. This book contains about 50 pages that cover the OS/2 threads API and its usage. It covers the API well, contains one nice example but very little theory.

Solaris Multithreaded Programming Guide. Sun Microsystems Press/Prentice Hall PTR, 1995. ISBN 0-13-160896-7. This is the documentation that comes with Solaris and contains all the information about the API. It is also available as part of the Solaris AnswerBook® and via the threads page on the WWW (see Appendix\x11C, Threads on the Net).

Using Multi-C: A Portable Multithreaded C Programming Library. Prentice Hall PTR, 1994. ISBN 0-13-606195-8. This book describes the API and use of the MIX Multi-C library, which is a proprietary library providing similar kinds of functionality to POSIX threads.

Related Papers

There are a number of papers from technical conferences that go into great detail of the different aspects of multithreading. You can find those that we felt were most interesting on the thread's home page. (See Appendix C, Threads on the Net.)

From the Back Cover

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. For programmers, system architects, and technical programmer managers.

More About the Author

Discover books, learn about writers, read author blogs, and more.

Customer Reviews

4.2 out of 5 stars
Share your thoughts with other customers

Most Helpful Customer Reviews

38 of 38 people found the following review helpful By A Customer on January 4, 1999
Format: Paperback
This was an excellent book with detailed coverage of threads programming even down to how various hardware architectures affect multithreaded program behavior. However there is a more current edition under a different name (Multithreaded Programming with Pthreads) by the same authors that is more current that I would recommend instead (everything in this book is in the newer book).
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
13 of 13 people found the following review helpful By A Customer on March 3, 1999
Format: Paperback
I would describe the books as concise, precise and extremely readable. The authors use fluid language and use the right technical terms in the right places. One of the best Computer Science books I have ever read. Definitely a good reference(though the book is not a comprehensive Operating Systems book) for a beginner who is looking to gain conceptual knowledge about Operating Systems in general and Multithreading in particular.
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
8 of 8 people found the following review helpful By on November 10, 1997
Format: Paperback
This book, true to other Solaris and Sun manual style, is concise and to the point. This is probably the best introduction to Threads Programming in existence. Lewis and Berg's style is almost reassuring as you learn the basics to threads programming, even for non-Solaris users. If the world of computing and how-to books were written in this style, the reader could learn anything.
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?