03 2015 档案

摘要:(1)client1,基于SIGIO的写法: 1 #include 2 #include 3 #include 4 #include 5 #include 6 7 #include 8 #include 9 #include 10 11 #define BUFSIZE 12812 1... 阅读全文
posted @ 2015-03-30 00:34 prepat 阅读(1043) 评论(0) 推荐(0)
摘要:转自:http://blog.csdn.net/historyasamirror/article/details/5778378向大牛学习,言归正传。同步(synchronous) IO和异步(asynchronous) IO,阻塞(blocking) IO和非阻塞(non-blocking)IO分... 阅读全文
posted @ 2015-03-30 00:00 prepat 阅读(435) 评论(0) 推荐(0)
摘要:先看poll(): 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define oops(x, n) { perror(x); exit(n); }10 11 int... 阅读全文
posted @ 2015-03-29 21:03 prepat 阅读(636) 评论(0) 推荐(0)
摘要:转自赖勇浩(http://laiyonghao.com)协程,又称微线程和纤程等,据说源于 Simula 和 Modula-2 语言(我没有深究,有错请指正),现代编程语言基本上都有支持,比如 Lua、ruby 和最新的 Google Go,当然也还有最近很让我惊艳的 falcon。协程是用户空间线... 阅读全文
posted @ 2015-03-25 13:21 prepat 阅读(13206) 评论(0) 推荐(1)
只有注册用户登录后才能阅读该文。
posted @ 2015-03-23 12:05 prepat 阅读(14) 评论(0) 推荐(0)
摘要:1 #include 2 3 #include 4 #include 5 #include 6 7 #define CMDSIZE 4096 8 9 static void prompt(void)10 {11 printf("[mysh]$ ");12 fflush... 阅读全文
posted @ 2015-03-16 15:10 prepat 阅读(800) 评论(0) 推荐(0)