Unix/Linux
born1985man
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
APUE 中的TELL函数
今天把APUE翻出来看看 那五个函数的实现可以作为学习的好例子TELL_WAIT TELL_PARENT TELL_CHILD WAIT_PARENT WAIT_CHILD1.用signal实现#include "apue.h"static int pdf1[1],pfd2[2];void TELL_WAIT(void){ if(pipe(pfd1)<0 || p原创 2009-10-06 12:42:00 · 701 阅读 · 1 评论 -
blp 4th edition-Chapter 12-Posix threads
创建线程int pthread_create(pthread_t *thread,pthread_attr_t *attr,void *(*start_routine)(void *),void *arg);return 0 on success,an error number if anything goes wrong结束线程void pthread_exit(void * r原创 2009-10-09 09:43:00 · 289 阅读 · 0 评论 -
blp 4th edition-Chapter 13-Inter Process Communication:Pipes
Pipe:connecting a data flow from one process to another进程管道:Process PipesFILE * popen(const char command,const char *open_mode);command:the name of the program to runopen_mode:must be "r" or原创 2009-10-09 10:51:00 · 347 阅读 · 0 评论 -
blp 4th edition-Chapter 11-Processes and Signals
Starting New Processint system(const char * string);等同于sh -c string 用exec函数族Replacing a Process Imageexec函数族replaces the current process with a new process specified by the path or file原创 2009-10-10 09:23:00 · 233 阅读 · 0 评论 -
blp 4th edition-Chapter 14:Semaphores,Shared Memory,and Message Queues.
Semaphore: for managing access to resourcesShared memory:for highly efficient data sharing between programsMessaging:for an easy way of passing data between programs 1.Semaphores一般来说一个thread原创 2009-10-10 20:29:00 · 408 阅读 · 0 评论 -
C traps and Puzzles
下面的例子都在Ubuntu8.04 GCC下编译的结果,有些没有给结果编程一定要自己动手试一试!1.定义与声明,定义要分配内存,声明只是声明在别处定义了int a; //定义extern int a; //声明 char str[100]extern char str[] //ok char * str[]extern char str[]原创 2009-10-14 11:27:00 · 268 阅读 · 0 评论 -
Linux下通用线程池的创建与使用
Linux下通用线程池的创建与使用本文给出了一个通用的线程池框架,该框架将与线程执行相关的任务进行了高层次的抽象,使之与具体的执行任务无关。另外该线程池具有动态伸缩性,它能根据执行任务的轻重自动调整线程池中线程的数量。文章的最后,我们给出一个简单示例程序,通过该示例程序,我们会发现,通过该线程池框架执行多线程任务是多么的简单。 为转载 2009-10-16 17:11:00 · 613 阅读 · 0 评论 -
RAID Level From Wiki
RAID 0RAID 1RAID 3RAID 4RAID 5RA转载 2009-10-19 16:04:00 · 401 阅读 · 0 评论
分享