Introduction to pThread
- Pthreads are defined as a set of C language programming types and procedure calls, implemented with a pthread.h header/include file and a thread library - though this library may be part of another library, such as libc, in some implementations.
- To implement a multi-threads program using pThread library:
#include <pthread.h>
- pthread_t: to define a thread id
- pthread_create: to create a thread
- pthread_join: join with a terminated thread
- pthread_mutex_t: to create a mutex in pthread
- pthread_mutex_lock: to lock a mutex in pthread
- pthread_mutex_unlock: unlock a mutex in pthead
- We will have some example programs later
- There are many functions you can use in pthread, you can refer to materials in google. Also, we provide some materials in useful links.