2017年2月22日
摘要: typedef unsigned long int pthread_t; //come from /usr/include/bits/pthreadtypes.h int pthread_create(pthread_t *thread, const pthread_attr_t *attr,voi 阅读全文
posted @ 2017-02-22 16:07 邶风 阅读(1421) 评论(0) 推荐(0) 编辑
摘要: 在多个CPU的主机上,线程是可以同时执行的。 多线程对于多进程的优点: 1、在多进程的情况下,每个进程都有自己的地址空间。而在多线程情况下,同一进程内的线程共享进程的地址空间, 因此,创建一个新的进程要耗费时间来为其分配系统资源,而创建一个新的线程花费的时间要少得多。 2、在系统调度方面,由于进程拥 阅读全文
posted @ 2017-02-22 14:14 邶风 阅读(702) 评论(0) 推荐(0) 编辑
摘要: int getpriority(int which, int who);返回一组进程的优先级 参数which和who确定返回哪一组进程的优先级 The value which is one of PRIO_PROCESS, PRIO_PGRP, or PRIO_USER, and who is in 阅读全文
posted @ 2017-02-22 09:58 邶风 阅读(6560) 评论(0) 推荐(0) 编辑