09 2014 档案
摘要:子线程循环10次,接着主线程循环100次,接着又回到子线程循环10次,接着再回到主线程又循环100次,如此循环50次,试写出代码。#include #include #include #include pthread_attr_t attr;pthread_mutex_t mutex;pthre...
阅读全文
摘要:1.线程属性线程具有属性,用pthread_attr_t表示,在对该结构进行处理之前必须进行初始化,在使用后需要对其去除初始化。我们用pthread_attr_init函数对其初始化,用pthread_attr_destroy对其去除初始化。1.名称::pthread_attr_init/pthre...
阅读全文
摘要:pthread_cond_wait()用于阻塞当前线程,等待别的线程使用pthread_cond_signal()或pthread_cond_broadcast来唤醒它。pthread_cond_wait()必须与pthread_mutex 配套使用。pthread_cond_wait()函数一...
阅读全文
摘要:Linux下怎样查看机器配置啊?cpu/内存/硬盘dmesg显示开机信息。kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息亦保存在/var/log目录中,名称为dmesg的文件里dmesg|grep hd硬盘dmesg|grep c...
阅读全文

浙公网安备 33010602011771号