摘要: 1. 编写规则 Some basic rules to coding a daemon prevent unwanted interactions from happening. We state these rules and then show a function, daemonize, that implements them. The first thing to d... 阅读全文
posted @ 2011-12-05 23:29 jialejiahi 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 1. 线程属性 什么东西都涉及到属性,程序里一涉及到属性的话,一般就是比较高级的要求了。比如socket的setsockopt函数比较重要。文件描述符的fcntl比较重要。同理,线程的: #include <pthread.h> int pthread_attr_init(pthread_attr_t *attr); int pthread_attr_destroy(pthr... 阅读全文
posted @ 2011-12-05 11:54 jialejiahi 阅读(449) 评论(0) 推荐(0) 编辑