Tutorial
Pthreads Programming: A Hands-on Introduction
Adrien Lamothe
Track: Programming
Date: Monday, July 23
Time: 8:30am
- 12:00pm
Location: D139-140
Concurrent programming is assuming increased importance in this era of multicore microprocessors. Pthreads is a tried and true method for developing multithreaded software, capable of leveraging the power of multicore CPUs.
Overview
A basic overview of concurrent programming concepts. Synchronization is the central challenge in multithreaded programming.
Profile Your Application
Your software's execution profile will determine whether it can benefit from multithreading. This is the first step in the concurrent programming process.
Basic Pthreads System Calls
We'll start with the basics, to instill familiarity before advancing to the trickier constructs. This will be done in C, under Linux (or BSD or Mac OS X if you prefer). Students will work on their own computers (most likely laptops).
Synchronization Primitives
Next, we'll add the various synchronization constructs, in a progressive fashion. The concept of thread-safe library calls will be introduced.
Debugging Multithreaded programs are a bit more challenging to debug than single-threaded ones. We'll use the multithreaded features of the GNU debugger.
Testing
Use your favorite dynamic scripting language to develop a test harness for your multithreaded application.
Caveats:
Not all operating systems and Pthreads libraries do the best job of implementing the Pthreads standard. We'll outline those systems we know work well and those with known problems.





















