Skip to Content
PThreads Programming
book

PThreads Programming

by Dick Buttlar, Jacqueline Farrell, Bradford Nichols
September 1996
Intermediate to advanced
286 pages
7h 11m
English
O'Reilly Media, Inc.
Content preview from PThreads Programming

Chapter 6. Practical Considerations

In this chapter:

Writing a multithreaded program is a lot like being a bebop jazz musician in the late Forties. It’s great to know what notes to play and the order in which to play them, but if the object is to play “Cherokee” as fast as possible, technique doesn’t matter all that much. You need to fit as many notes in as short a space of time as possible and be done it with before the audience can catch its breath. It’s performance, performance, performance!

So it is with you, the writer of threaded applications. Portable library calls that provide task concurrency within a process are fine, but only if they deliver on the promised performance. So in this chapter, we move from the abstract to the practical, from the world of standards and reference pages to the world in which things often go wrong or don’t go as well as we’d like. With this in mind, our discussions will focus on:

Pthreads implementations

Pthreads implementations differ to the degree to which they’re based in user space or kernel space. The way in which a thread library is designed on a given platform determines how your threads are scheduled, whether they can actually run in parallel, and, ultimately, how well they perform. Knowing a little bit about how your platform supports Pthreads can help you design your program to take advantage of the implementation’s strong points

Debugging

Debugging a multithreaded program ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Programming with POSIX ® Threads

Programming with POSIX ® Threads

David R. Butenhof

Publisher Resources

ISBN: 9781449364724Errata Page