ChinaUnix.net
相关文章推荐:

linux下多线程

线程库用的是linuxThread 程序只有一个进程,此进程里面有好几十个线程,现在发现只要执行kill 某一线程后整个进程都kill掉了,谁都告诉原因呀?

by JavaAnd - C/C++ - 2009-08-19 15:42:54 阅读(1780) 回复(8)

相关讨论

关于linux线程编程,小弟遇到了点麻烦,请各位指导一,谢谢. 这是编译时的错误信息: [root@localhost thread]# g++ -o mutilthread main.cpp main.cpp: In function `int main()': main.cpp:14: error: invalid conversion from `void*' to `void*(*)(void*)' main.cpp:14: error: initializing argument 3 of `int pthread_create(pthread_t*, const pthread_attr_t*, void*(*)(void*), void*)' main.cpp:17: error: `exit'...

by gbtux - 程序开发 - 2006-06-28 16:30:55 阅读(1243) 回复(5)

我最近在尝试将原来的dos的程序重新在linux线程重新写,在看过了网上前辈的教程之后,我看到如程序:#include ; #include ; void thread(void) { int i; for(i=0;i<3;i++) printf("This is a pthread.\n"); } int main(void) { pthread_t id; int i,ret; ret=pthread_create(&id,NULL,(void *) thread,NULL); if(ret!=0){ printf ("Create pthread error!\n"); exit (1); } for(i=0;i<3;i++) print...

by jianfeibaobao - 内核/嵌入技术 - 2005-07-27 13:33:16 阅读(985) 回复(3)

想问一,如果我想同时最只运行n个线程(n个线程做的工作是一样的),应该如何实现? 进程的话,可以用wait,等待任意一个进程的结束,然后开始一个新的进程,从而保证总进程数是一定的。可线程里的pthread_join只能等待一个特定的进程(类似于waitpid),这应该怎么办呢?

by datou123654789 - 程序开发 - 2004-11-09 08:18:59 阅读(709) 回复(1)

linux有没有类似flashget或讯雷之类的载工具,最好是命令行的。加快载的速度。

by 刘五十三 - 桌面与办公 - 2006-11-02 00:04:07 阅读(1129) 回复(5)

我先说明我的情况: example.c中有main函数, pthread_mutex_t mymutex;//全局 main() {   …… ……   pthread_mutex_init( &mymutex, NULL );   pthread_create( &id, NULL, my_net_transfer, NULL );   pthread_mutex_lock( &mymutex );   …… ……   pthread_mutex_unlock( &mymutex ); } net.cpp中有my_net_transfer函数, void my_net_transfer( void ) {   pthread_mutex_lock( &mymutex );     ...

by eNsEmpire - C/C++ - 2008-09-25 11:28:21 阅读(1781) 回复(7)

linux 用gdb调试线程程序 怎样让让当前调试的context 在程序执行了pthread_create后,直接转到创建的线程

by yeajchao - C/C++ - 2006-10-11 12:26:07 阅读(2626) 回复(6)

更直接的说是server 需要用pthread_create出一个线程来处理一个客户端的请求 我目前只知道mysql, 还有没有其它的比较简单的线程服务器呢? 我在收集这样的程序, 知道的请说一声, 谢谢

by tony2005 - 服务器架设 - 2006-08-08 05:04:14 阅读(585) 回复(0)

RedHat AS3 U2上运行的进程创建了线程,系统运行一段时间后就会出现其中一个线程莫名其妙的不工作了,大约过几个小时之后又恢复正常了,我的系统要求实时运行的,线程停了就会造成很大的故障,这个问题已经困扰我一个月了,这里的各位高手知道是啥原因么? 我模拟测试了几万次都不会出现问题,一放到实际系统中就会出问题,快疯掉了,帮帮我吧,谢谢了

by chendf - C/C++ - 2006-05-17 09:36:32 阅读(1047) 回复(6)

求助linux线程的开发资料!!!

by atg - 程序开发 - 2006-03-28 19:31:00 阅读(1717) 回复(10)

找了很久都没找到linux线程ftp载软件(同时可以浏览ftp的那种),只找到了到d4x,是支持线程载,但无法浏览ftp 。 另外,都说自带的gftp支持线程,请问怎么设置? 还是我理解错了gftp的这个线程的意思? 谢谢

by zjnoah - 服务器架设 - 2005-03-17 07:52:23 阅读(1115) 回复(0)