Thread Library
A thread library provides the programmer with an API for creating and managing threads.
There are two primary ways of implementing a thread library.
- The first approach is to provide a library entirely in user space with no kernel support.
- The second approach is to implement a kernel-level library supported directly by the operating system.
asynchronous threading and synchronous threading
- With asynchronous threading, once the parent creates a child thread, the parent resumes its execution, so that the parent and child execute concurrently. Each thread runs independently of every other thread, and the parent thread need not know when its child terminates. Because the threads are independent, there is typically little data sharing between threads.
- Synchronous threading occurs when the parent thread creates one or more children and then must wait for all of its children to terminate before it resumes —the so-called fork-join strategy.