采用多生产者,多消费者模型。1234567891011121314151617/** * 生产者 */P(nempty);P(mutex);// 写入一个空闲位置V(mutex);V(nstored); /** * 消费者 */P(nstored);P(mutex):// 清空一个非空闲位置V(mu...
分类:
其他好文 时间:
2015-08-17 18:48:12
阅读次数:
211
阻塞I/O(blocking I/O)
非阻塞I/O (nonblocking I/O)
I/O复用(select 和poll) (I/O multiplexing)
信号驱动I/O (signal driven I/O (SIGIO))
异步I/O (asynchronous I/O (the POSIX aio_functions))
前四种都是同步,只有最后一种才是异步IO...
分类:
系统相关 时间:
2015-08-17 12:03:41
阅读次数:
202
1. 如果直接在操作系统中进行命令行操作,那么一般使用的是操作系统所提供的接口函数,而如果想在python中也能够调用操作系统的接口函数来对文件,目录进行操作的话,可以使用os和os.path模块,这些模块可以直接调用操作系统提供的接口函数
2. >>>os.name ,name属性会反映出操作系统的一些信息,如果是posix,说明系统是Linux、Unix或Mac OS X,如果是nt,就...
分类:
编程语言 时间:
2015-08-14 21:24:45
阅读次数:
151
perl核心模块解析(一) POSIX
详细文档链接如下
源自:http://blog.csdn.net/jonathanxqs
转自:http://perldoc.perl.org/POSIX.html
POSIX/?p?z?ks/,
是可移植操作系统接口(Portable
Operating System Interface ),POSIX标...
分类:
其他好文 时间:
2015-08-14 19:06:12
阅读次数:
5320
#include
是POSIX.1标准定义的unix类目录操作的头文件,包含了许多UNIX系统服务的函数原型,例如opendir函数、readdir函数.
opendir函数:
DIR *opendir(const char *pathname);返回值:若成功则返回指针,若出错则返回NULL。
struct dirent *readdir(DIR *dp); 返回值:若成功则返回指针,若...
分类:
其他好文 时间:
2015-08-14 15:49:00
阅读次数:
104
struct mq_attr{ long mq_flags; /* message queue flag : 0, O_NONBLOCK */ long mq_maxmsg; /* max number of messages allowed on queue*/ ...
分类:
其他好文 时间:
2015-08-13 22:08:48
阅读次数:
351
/* Query status and attributes of message queue MQDES. */extern int mq_getattr (mqd_t __mqdes, struct mq_attr *__mqstat) __THROW __nonnull ((2));/* .....
分类:
其他好文 时间:
2015-08-12 23:19:46
阅读次数:
189
部分参考:http://www.cnblogs.com/Anker/archive/2013/01/04/2843832.htmlIPC对象的持续性:http://book.51cto.com/art/201006/207275.htm消息队列可以认为是一个消息链表,某个进程往一个消息队列中写入消息...
分类:
其他好文 时间:
2015-08-12 21:37:04
阅读次数:
275
首先,Linux是一套免费使用和自由传播的类unix操作系统,是一个基于posix和unix的多用户、多多任务、支持多线程和多CPU的操作系统。严格且简单的讲,linux就是一个操作系统的内核。那linux能做什么呢,她可以做服务器、跑网站、个人PC、手机(Android,苹果unix)、门禁系统、..
分类:
系统相关 时间:
2015-08-09 18:59:30
阅读次数:
173
【版权声明:尊重原创。转载请保留源:blog.csdn.net/shallnet 要么 .../gentleliu,文章学习交流,不用于商业用途】 system V共享内存和posix共享内存类似,system V共享内存是调用shmget函数和shamat函数。 shmget...
分类:
系统相关 时间:
2015-08-08 09:07:02
阅读次数:
189