Using threads is especially advantageous when building a distributed system. These systems frequently contain a shared network server, where the server services requests from multiple clients. A program with multiple threads can be especially suited to run on a multiprocessor system, where threads run concurrently on separate processors. Threads A thread is a single, sequential flow of control within a process. Within each thread there is a single point of execution.
Most traditional programs execute as a process with a single thread.
Using Compaq's multithreading run-time library, a programmer can create several threads within a process. The process' threads execute concurrently. Within a multithreaded program there are at any time multiple points of execution. When the threads access the same memory locations, your program must use synchronization elements, such as mutexes and condition variables, to ensure that the shared memory is accessed correctly. The Threads Library provides routines that allow you to use these and other synchronization objects.