Thread Libraries

With the help of thread libraries, programmers can implement multi-threading in their programs. Libraries could be either user space (C++, Java, etc.) or kernel space (system calls.)

The three most popular thread libraries are:

  1. POSIX Pthreads – A Linux (user or kernel) library that is provided as an extension to the POSIX standard.
  2. Win32 threads – provided as a kernel-level library on Windows systems.
  3. Java threads – since the execution of Java programs depends on the OS on which the JVM is running, the underlying library will be either POSIX Pthreads or Win32 threads.

Here are links to screenshots with sample C programs that use the POSIX Pthreads library and the Win32 threads library.

In the next slides, we describe and illustrate how a Java threads example works.