LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 729|回复: 0

多线程通信程序线程创建失败 EAGAIN

[复制链接]
发表于 2004-5-10 15:52:54 | 显示全部楼层 |阅读模式
我在编写的一个多线程网络程序(我的系统是AIX),在创建线程时报错EAGAIN,我查了man page,里面对错误的描述是这样的
ERRORS
       EAGAIN not enough system resources to create  a        process         for  the  new
              thread.

       EAGAIN more than PTHREAD_THREADS_MAX threads are already active.
我又查了sys/limits.h PTHREAD_THREADS_MAX 值为512,并且我的程序里面没有动态分配内存,因此不大可能是进程的内存耗尽,
不知道还有没有其他限制导致线程无法创建,请各位指点,我的代码如下:

iRet=pthread_create(&tid,NULL,&Deal,(void *)&conninfo[iCurr]);
                        if(iRet!=0)
                        {
                                pthread_mutex_lock(&thread_flag);
                                conninfo[iCurr].iUsed=0;
                                m_Connects--;
                                pthread_mutex_unlock(&thread_flag);
                                WriteLOG("ERROR: create thread failure,code=%d\n",iRet);
                                resp_ptr->cResult    = SYSTEM_ERR;
                        }
                        else
                        {
                                resp_ptr->cResult    = 0;
                        }
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表