 | | The boss creates each worker thread, assigns it tasks, and, if necessary, waits for it to finish. In the pseudo code in Example 2-1, the boss dynamically creates a new worker thread when it receives a new request. In the pthread_create call it uses to create each worker thread, the boss specifies the task-related routine the thread will execute. After creating each worker, the boss returns to the top of its loop to process the next request. If no requests are waiting, the boss loops until one arrives. | |
|