Best Practices in Pthreads Multithreaded Programming
This 2- to 3-day lecture-lab course covers:
- Thread basics and thread/process relationship
- Threading models and program design
- Thread life cycles and management
- Synchronization with locks, mutexes, condition variables, and semaphores
- Program Parallelism
- Performance on single and multiprocessor systems: Pitfalls, guidelines, and scalability
- Predicates, invariants, and safety properties
- Attribute objects
- Thread-specific data
- Debugging and profiling
Text: Programming with POSIX Threads by David Butenhof
Full Course Schedule
The actual contents and duration can be customized to be appropriate for the participants' experience and requirements. There are extensive exercises and demonstrations tailored to the lecture material.
Course Schedule with Approximate Times
- About This Course (0.5 Hour)
- Introduction (0.5 Hour)
- POSIX Pthreads Management Essentials (2.0 Hours)
- POSIX Synchronization Basics - Mutexes and Condition Variables (4.0 Hours)
- Debugging and Dynamic Analysis (1.5 Hours)
- Thread-Safe Libraries and Thread-Specific Data (2.0 Hours)
- Advanced Thread Models: Programming, Reliabililty, and Performance Impact (2.5 Hours)
- Thread Exceptions, Termination, and Cancellation (2.5 Hours)
- Thread Scheduling, Designing for Performance, Avoiding Performance Pitfalls (2.0 Hours)
- Multiprocessor Systems and Program Parallelism. Program Design Strategies (2.0 Hours)
- Extended Exercises Including Client/Server Computing (2.0 Hours)
- Advanced Pthreads Features (2.5 Hours)
- Vendor and Platform Specific Considerations (1.0 Hour)
Additional thread debugging and profiling topics are covered throughout the course. Times include exercises and demonstrations, and the pace can be adjusted to suite your needs.
Audience: Software engineers and programmers, including those with some experience with threads, who need to learn how to develop reliable, high-performance multithreaded Pthreads client, desktop, and server applications.
Prerequisites: Knowledge of C (or C++, Java, etc.) programming, experience developing UNIX or Linux applications. Prior experience with thread management and synchronization is helpful, but not required.