ChinaUnix.net
相关文章推荐:

c#线程池

/* ------------------------------------------------------------------------- * log.h * ------------------------------------------------------------------------- */ #ifndef __LOG_H #define __LOG_H #include #include #define LOGLINE_MAX 1024 typedef struct { int fd; sem_t sem; int flags; } log_t; #define DEBUG 1 #define INFO 2 #define WARN 3 #define ER...

by jyh20031984 - C/C++ - 2009-12-16 17:20:04 阅读(13507) 回复(21)

相关讨论

由二部分组成,一个线管理类ThreadManager,一个线类MyThread Test类是用来测试的 参考了以下资料: http://tech.ccidnet.com/pub/disp/Article?columnID=294&articleID=33440&pageNO=1 http://soft.yesky.com/SoftChannel/72342371961929728/20041013/1863707.shtml 下面是代码,希望大家提出更好的建议: 1.ThreadManager.cs using System; using System.Threading; using System.Collections; namespace CustomTh...

by allys586 - Web开发 - 2008-08-14 12:17:44 阅读(1236) 回复(0)

最近写的线公用开发库,带一个简单的测试代码,使用了队列进行线分批。可以同时创建多个线。欢迎大家指点批正。 直接运行 make ,然后执行生成的 pools 测试序。 下面是核心部分代码: int pool_dispatch(pool* pl, void(*cb)(void*), void* arg) { pool_thread* thread; pool_queue_item* item; pthread_mutex_lock(&(pl->mutex)); if(0 == pl->idle_total) { pthread_mutex_unlock(...

by lowellzhong - C/C++ - 2007-12-11 18:49:43 阅读(1756) 回复(3)

1 请问如何在Linux中用标准C++实现线; 我想定义一个类在这个类中封装对线的操作,但用线的函数只能定义为静态的或全局的,这样它成分类的方法,如何是它能够在创建不同的对象时每个对象能有自己的线操作方法。 2 请问在Linux中如何暂停一个线,到合适的时候再将它唤醒

by yifang - C/C++ - 2004-03-15 15:16:21 阅读(2036) 回复(2)

今天看了很多线的介绍,就是没有找到C的线实现函数(如线的创建是pthread_create,线的创建呢?)。那位高手能帮忙介绍一下?

by FengFei - C/C++ - 2003-08-11 18:10:17 阅读(1535) 回复(4)

在网上搜了下,大多是Java或者C++之类的,谁有C写的,分享一下哈,谢谢:)

by 030802127 - C/C++ - 2009-11-26 14:52:25 阅读(9363) 回复(16)

[code] /******************************************************* * HdrFileName: thrdpool.h * Description: Implement a thread pool. * CreateDate : 2005.7.16 * Author : peijianzhong * Email : pjz0311@emails.bjut.edu.cn * Version : 1.0 * Interface : * thrdpool_t *createThrdPool( int maxthrds, int maxclts, char *plogfile ); * int addClt( thrdpool_t *pthrdpool, int cltid,...

by pjz0311 - C/C++ - 2005-07-25 10:37:19 阅读(2586) 回复(9)

各位同好,急需unix下线的源代码,在网上找到本版去年11月份的帖子,其中的链接源代码已经没有了,有哪位大侠给我传一个?多谢! 去年帖子的链接是这个: http://www.numerik.uni-kiel.de/~rok/projects/threadpool/download.html 我的email:srivatsa2003@sina.com :!:

by sun_hp_ibm - C/C++ - 2005-02-18 09:34:07 阅读(1644) 回复(2)

1 请问如何在Linux中用标准C++实现线; 我想定义一个类在这个类中封装对线的操作,但用线的函数只能定义为静态的或全局的,这样它成分类的方法,如何是它能够在创建不同的对象时每个对象能有自己的线操作方法。 2 请问在Linux中如何暂停一个线,到合适的时候再将它唤醒

by yifang - 程序开发 - 2006-02-28 12:09:14 阅读(2092) 回复(3)
by hxs880 - C/C++ - 2008-10-30 20:31:26 阅读(1726) 回复(3)

&Config::AUTOLOAD failed on Config::launcher at F:/Perl/lib/Config.pm line 72. 请问在windows下安装了thread::pool模块,运行一个小例子报上面的错误,哪位好心人解释一下怎么处理!谢谢!

by qiqi562877 - Perl - 2007-11-23 09:51:07 阅读(1540) 回复(0)