C++ 为什么pthread_create()有时会在Cygwin端口上提供EAGAIN?

C++ 为什么pthread_create()有时会在Cygwin端口上提供EAGAIN?,c++,cygwin,pthreads,porting,C++,Cygwin,Pthreads,Porting,pthread_create()返回errno 11(EAGAIN),“资源暂时不可用”是什么意思 我正在将我的应用程序移植到Cygwin,它在Centos 4上运行良好。每隔一段时间,应用程序对pthread_create()的调用就会失败,但大多数情况下,它工作正常 这意味着什么是出了问题 Linux Centos 4手册页上说: EAGAIN The system lacked the necessary resources to create another th

pthread_create()返回errno 11(EAGAIN),“资源暂时不可用”是什么意思

我正在将我的应用程序移植到Cygwin,它在Centos 4上运行良好。每隔一段时间,应用程序对pthread_create()的调用就会失败,但大多数情况下,它工作正常

这意味着什么是出了问题

Linux Centos 4手册页上说:

   EAGAIN The  system  lacked  the  necessary  resources  to  create  another  thread,  or  the  system-imposed  limit  on  the  total  number of threads in a process
          {PTHREAD_THREADS_MAX} would be exceeded.
我怀疑我正在使用PTHREAD\u THREADS\u MAX,那么Cygwin系统如何耗尽资源来创建另一个线程呢

如果出现以下情况,pthread_create()函数将失败:
EAGAIN
系统缺少创建另一个线程所需的资源,或者系统对进程{PTHREAD_threads_MAX}中的线程总数施加的限制将被超过


发布一些资源后,您可以再试一次。

我在几个项目中遇到了相同的问题,并且总是将其归为cygwin的众多警告之一+1@Tim发布你的工作内容?大多数时候,你收到的邮件都意味着一些资源不可用,你应该再试一次。当函数被代码内核部分中的中断或陷阱中断(内部),并且无法保证内部状态一致时,也会发生这种情况。所以你应该再试一次。