ChinaUnix.net
相关文章推荐:

libevent thread

libevent的事件回调函数中close不发送FIN序列,不知道大家有没有遇到这个问题。。。。 不知道为什么?????

by zsniper - C/C++ - 2007-10-26 11:24:28 阅读(1708) 回复(0)

相关讨论

完整的代码在 http://spserver.googlecode.com/files/libevent-1.4.4-iocp-3.zip 思路介绍:http://iunknown.javaeye.com/blog/199143 这里有人在 windows 下使用 libevent 吗?是否有人愿意尝试一下这个 iocp 版的 libevent ? 目前的这个代码已经可以通过 libevent 自带的 regress.c 的大部分测试案例。 libevent 原来自带的 libevent/WIN32-Prj 目录中的 dsw 和 dsp 有问题。 这次用的 dsw 和 dsp 在 libevent/libevent-iocp...

by iunknown - C/C++ - 2008-08-23 15:36:51 阅读(17788) 回复(29)

from http://blog.gslin.net 在課堂上學過 Unix Network Programming 後,我們知道在處理多 User 時會有幾種方法 解決: 1. 一個新的 Connection 進來,用 fork() 產生一個 Process 處理。 2. 一個新的 Connection 進來,用 pthread_create() 產生一個 thread 處理。 3. 一個新的 Connection 進來,丟入 Event-based Array,由 Main Process 以 Nonblocking 的方式處理所有的 I/O。 這三種方法當然也都有各自的缺點: ...

by redsnow - 网络技术文档中心 - 2006-11-27 13:21:35 阅读(2741) 回复(0)

POSIX thread 一 概述       Pthread是一套通用的线程库, 它广泛的被各种Unix所支持, 是由POSIX提出的. 因此, 它具有很好的可移植性.  例1:     /**/     #include pthread.h>     void *pp(void *arg)     {         while (1) { ...

by Arthursky - BSD文档中心 - 2009-04-14 09:12:58 阅读(1426) 回复(0)

结构就是起两个线程 一个做server 一个做client 通过本地的8888的端口 #include thread.h> #include #include #include #include #include #include #include #include #include #include volatile int RecvFD = 0; volatile int SendFD = 0; volatile int RecvSD = 0; volatile int ...

by senic - C/C++ - 2008-09-08 10:11:03 阅读(1899) 回复(2)

有人在windows下用过这个模块吗?为什么用threds模块可以实现多线程,但使用use thread;就总是报错!下面是用thread::Pool模块时报的错: Undefined subroutine &threads::new call at C:/Perl/site/lib/thread/Pool.pl line 110 我也单独试了,用thread模块,启动不了多线程!麻烦大家给分析一下!下面是thread模块的一个小例子,大家看看哪里错了! #!c:\perl\bin\perl -w use thread; my @threads; my @info; $info[0]="1";...

by qiqi562877 - Perl - 2011-02-08 02:37:25 阅读(3487) 回复(6)

贴子已过期 [ 本帖最后由 polo1 于 2007-5-3 19:27 编辑 ]

by polo1 - PHP - 2007-05-03 12:57:24 阅读(1267) 回复(1)

#ifdef HAVE_CONFIG_H #include ; #endif #include ; #include ; #includethread.h>; struct student { char name; int num; } void hello(void*arg) { struct student *student2; student2=(struct student *)arg; (*student2).name; pthread_exit(0); } main() { pthread_t tid; struct student*student1; (*student1).name='h'; (*student1).num=2; ...

by lrh_0_2000 - C/C++ - 2005-09-12 19:36:39 阅读(1139) 回复(6)

this thread is deleted

by ltcstyle - 服务器应用 - 2004-12-01 07:51:25 阅读(652) 回复(0)

x=10; thread T1 thread T2 thread T3 down(s); down(s); x=x+1; x=x*2; x=x/2; up(s); up(s); 执行后会有几种结果. 我只知道几种顺序,不知道全部. 求教!

by jerryzzh - C/C++ - 2003-03-24 05:00:45 阅读(678) 回复(0)