 | | Now that we've seen how UNIX programmers traditionally add concurrency to a program, let's look at a way of doing so that employs threads. Example 1-4 shows how our single-process program would look if multiple threads execute its procedures concurrently. The program starts in a single thread, which, for reasons of clarity, we'll refer to as the main thread. For the most part, the operating system does not recognize any thread as being a parent or master thread—from its viewpoint, all threads in a process are equal. | |
|