--------------------------------------
fork - create a child process#include <unistd.h>pid_t fork(void);exec系列。
int pthread_create(pthread_t *restrict tidp,const pthread_attr_t *restrict_attr,void*(*start_rtn)(void*),void *restrict arg);
--------------------------------------exit - cause normal process termination#include <stdlib.h>void exit(int status);atexit - register a function to be called at normal process termination
#include <stdlib.h>int atexit(void (*function)(void));1 函数返回
2 进程终止3 void pthread_exit(void *retval)--------------------------------------
pid_t waitpid(pid_t pid, int *status, int options);pthread_join(pthid,int *status);
pthread_detach(pthread_self());--------------------------------------getpid();
pthread_self();--------------------------------------
pid_tpthread_t--------------------------------------pthread_mutex_t
pthread_mutex_lock(&pthread_mutex_t)pthread_mutex_unlock(&pthread_mutex_t)pthread_cond_t INITIALIZER
pthread_cond_signal(&pthread_cond_t)pthread_cond_wait(&pthread_cond_t,&pthread_mutex_t )pthread_cond_broadcastpthread_cond_timewaitpthread_key_t
pthread_once_tpthread_key_create(&key,destory)
//一个进程对应128个key结构,这里返回的key就是一个数组下标pthread_setspecific(key, void *)void * pthread_getspecific(key)pthread_once(&pthread_once_t, func)
--------------------------------------线程共享1 打开的文件描述符(不增加文件描述符的引用计数)2 信号处理函数和信号处置3 大多数数据(全局变量)