Skip to Main Content
PThreads Programming
book

PThreads Programming

by Dick Buttlar, Jacqueline Farrell, Bradford Nichols
September 1996
Intermediate to advanced content levelIntermediate 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.
Start your free trial

You might also like

Programming with POSIX ® Threads

Programming with POSIX ® Threads

David R. Butenhof

Publisher Resources

ISBN: 9781449364724Supplemental ContentErrata Page