2.1 Why Threads?
2.2 Programming with Threads
2.2.1 Thread Creation and Termination
22.214.171.124 Creating POSIX Threads
126.96.36.199 Creating Win-32 Threads
188.8.131.52 Handling Multiple Arguments
184.108.40.206 Thread Termination
220.127.116.11 Attributes and Stack Size
2.2.2 Threads and C++
18.104.22.168 Mutual Exclusion
22.214.171.124 Beyond Mutual Exclusion
2.2.4 Thread Safety
126.96.36.199 Unix Signals
188.8.131.52 POSIX Cancellation
In computer systems many things must go on at the same time; that is, they must be concurrent. Even in systems with just one processor, execution is generally multiplexed, providing at least the illusion that many things are happening at once. At any particular moment there may be a number of running programs, a disk drive that has completed an operation and requires service, packets that have just arrived from the network and also require service, characters that have been typed at the keyboard, etc. The operating system must divide processor time among the programs and arrange so that they all make progress in their execution. And while all this is going on, it must also handle all the other input/output activities and other events requiring attention as well.
This chapter covers multithreaded programming. The discussion here not only goes through the basics of using concurrency in user-level programs, but also introduces a number of concepts that are important in the operating system. ...