<pthread.h>

pthread_equal

pthread_self(void)

pthread_create()

pthread_close()

pthread_join()

phread_cancel()

pthread_cleanup_push()

pthread_cleanup_pop()

同步:

1互斥量

pthread_mutex_init()

pthread_mutex_destory()

pthread_mutex_lock()

pthread_mutex_trylock()

pthread_mutex_unlock()

2读写锁:3种状态,读状态锁(可多个),写(同时只一个),不加锁

pthread_rwlock_init()

pthread_rwlock_destroy()

pthread_rwlock_rdlock()

pthread_rwlock_wrlock()

pthread_rwlock_tryrdlock()

pthread_rwlock_trywrlock()

pthread_rwlock_unlock()

3 条件变量

本身由互斥量保护

pthread_cond_init()

pthread_cond_destory()

pthread_cond_wait()

pthfead_cond_timewait()

pthread_cond_signal()

pthread_cond_broadcast()

高级UNIX环境编程11 线程的更多相关文章

  1. 高级UNIX环境编程

    常规文件 只有索引节号(i-number,是一批i-node的索引),i-node不含文件名及数据字节,包括文件类型,链接数量,uid,gid,访问权限,字节数,最后访问时间,最后修改时间,信息节点最 ...

  2. 高级UNIX环境编程7 进程

    每个程序都会收到一张环境表 extern char **environ; c程序的存储空间布局: 正文段:共享,只读 初始化数据段:存函数以外的赋值 非初始化数据段(bbs):block starte ...

  3. 高级UNIX环境编程5 标准IO库

    标准IO库都围绕流进进行的 <stdio.h><wchar.h> memccpy 一般用汇编写的 ftell/fseek/ftello/fseeko/fgetpos/fsetp ...

  4. 高级UNIX环境编程13 守护进程

    linux下,keventd守护进程为内核中运行的执行的函数提供进程上下文 bdflush,kupdated将高速缓存中的数据冲洗到磁盘上

  5. 高级UNIX环境编程10 信号

    信号是软件中断,提供一种处理异步事件的方法 <signal.h> sigaction()

  6. 高级UNIX环境编程4 文件和目录

    #include<sys/stat.h> stat fstat lstat fchmod 对已打开的文件操作

  7. 高级UNIX环境编程3 FILE IO

    POSIX中,STDIN_FILENO,STDOUT_FILENO,STDERR_FILENO 对应0,1,2 每个打开的文件都有一个与其想关联的 "current file offset& ...

  8. 高级UNIX环境编程2

    perror("error:") ;  strerror 日历时间:time_t (1970.1.1开始的秒数)     struct timeval (秒数和微秒)  struc ...

  9. UNIX环境编程学习——反思认识

     学习情况: 有关UNIX系统环境编程的学习时间用来非常长的时间.可是感觉效果还是不是太好,在中间经过了期末考试.用来非常长的时间用来学习专业课.就将该过程的学习放到了一边上,放假以后又回家造成了 ...

随机推荐

  1. IOS开发笔记 IOS如何访问通讯录

    IOS开发笔记  IOS如何访问通讯录 其实我是反对这类的需求,你说你读我的隐私,我肯定不愿意的. 幸好ios6.0 以后给了个权限控制.当打开app的时候你可以选择拒绝. 实现方法: [plain] ...

  2. 调用Android自带日历功能(日历列表单、添加一个日历事件)

    调用Android自带日历功能  觉得这篇文章不错,转载过来. 转载:http://blog.csdn.net/djy1992/article/details/9948393 Android手机配备有 ...

  3. ThinkPad x200为何总是CPU占用50%

    2009年,我从美国买回一台ThinkPad X200 Tablet,Windows XP Tablet PC Edition 2005版,服役几年一直很正常.直到2012年初的时候,突然发现电脑非常 ...

  4. CodeForces 22C System Administrator

    把v和2结点交换, 1和v连,其它点和v之间能够互相连. #include <iostream> #include <cstdlib> #include <cstring ...

  5. c++中string::function集合

    string append() 1.直接添加另一个完整的字符串: str1.append(str2); 2.添加另一个字符串的某一段字串:    str1.append(str2, 11,  7); ...

  6. BZOJ 1001: [BeiJing2006]狼抓兔子(最短路)

    平面图的最小割转化为对偶图的最短路(资料:两极相通——浅析最大最小定理在信息学竞赛中的应用) ,然后DIJKSTRA就OK了. ------------------------------------ ...

  7. Android Developers:按需求加载视图

    有时候你的布局可能需要较少使用的复杂视图.无论它们是项目详情,进度指示器,或者处理的信息,你能通过在它们被需要的时候加载的方式,来减少内存消耗和加快显示. 定义一个ViewStub ————————— ...

  8. codeforces 628F. Bear and Fair Set 网络流

    题目链接 F. Bear and Fair Set time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  9. Python每日一练(1):计算文件夹内各个文章中出现次数最多的单词

    #coding:utf-8 import os,re path = 'test' files = os.listdir(path) def count_word(words): dic = {} ma ...

  10. Python collections.defaultdict 笔记

    其实defaultdict 就是一个字典,只不过python自动的为它的键赋了一个初始值.这也就是说,你不显示的为字典的键赋初值python不会报错,看下实际例子. 比如你想计算频率 frequenc ...