Chinaunix首页 | 论坛 | 博客
  • 博客访问: 70157
  • 博文数量: 24
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 245
  • 用 户 组: 普通用户
  • 注册时间: 2014-12-10 08:06
文章分类
文章存档

2015年(24)

我的朋友

发布时间:2015-06-02 10:14:36

编程实现三个线程ABC,并让它们顺次打印ABC点击(此处)折叠或打开#include<stdio.h>#include<stdlib.h>#include<pthread.h>#include<semaphore.h>#include<string.h>/* *声明3个线程.........【阅读全文】

阅读(1807) | 评论(0) | 转发(0)

发布时间:2015-06-01 22:51:53

1、pthread_mutex_init调用函数所需头文件:pthread.h函数原型:int pthread_mutex_init(pthread_mutex_t * restrict mutex, const pthread_mutexattr_t *restrict attr);参数解释:mutex: 指向互斥信号量对象。attr:指定互斥量的属性,当为空时使用默认的属性作用:以动态的方式创建信号量2、pthread_mutex.........【阅读全文】

阅读(767) | 评论(0) | 转发(0)

发布时间:2015-05-31 23:20:38

1、sem_init调用函数所需头文件:semaphore.h函数原型 :int sem_init(sem_t *sem, int pshared, unsigned int value);参数解释 :sem :指向信号量对象pshared : 指明信号量的类型。当为0时,用于进程;当为0时,用于线程。value : 指定信号量值的大小返回值:成功返回0,失败时返回-1,并设置errno。作用:创建信.........【阅读全文】

阅读(9762) | 评论(0) | 转发(0)

发布时间:2015-05-30 23:11:46

调用函数所需的头文件  pthread.h函数原型: int pthread_create(pthread_t  *pthread, const pthread_attr_t *attr, void *(*start_routine)(void *), void * arg)所需链接:   -lpthread参数解释:pthread:指向线线程标识符attr : 用来设置线程的属性start_routine :线程函数名arg :传入线.........【阅读全文】

阅读(1128) | 评论(0) | 转发(0)

发布时间:2015-05-30 15:21:27

/etc etc不是什么缩写,是and so on的意思 来源于 法语的 et cetera 翻译成中文就是 等等 的意思. 至于为什么在/etc下面存放配置文件, 按照原始的UNIX的说法(linux文件结构参考UNIX的教学实现MINIX) 这下面放的都是一堆零零碎碎的东西, 就叫etc, 这其实是个历史遗留.这个目录一般用来存放程序所需的整个文件系统的配置.........【阅读全文】

阅读(989) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册