Pthread_create Error Eagain
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta pthread_join Discuss the workings and policies of this site About Us Learn pthread_join example more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us pthread_attr_init Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, pthread_exit helping each other. Join them; it only takes a minute: Sign up pthread_create and EAGAIN up vote 0 down vote favorite I got an EAGAIN when trying to spawn a thread using pthread_create. However, from what I've checked, the threads seem to have been terminated properly. What determines the OS to give EAGAIN when trying to create
Pthread_detach
a thread using pthread_create? Would it be possible that unclosed sockets/file handles play a part in causing this EAGAIN (i.e they share the same resource space)? And lastly, is there any tool to check resource usage, or any functions that can be used to see how many pthread objects are active at the time? pthreads posix memory-leaks share|improve this question asked Dec 26 '11 at 10:07 kamziro 2,27542859 add a comment| 3 Answers 3 active oldest votes up vote 6 down vote accepted Okay, found the answer. Even if pthread_exit or pthread_cancel is called, the parent process still need to call pthread_join to release the pthread ID, which will then become recyclable. Putting a pthread_join(tid, NULL) in the end did the trick. edit (was not waitpid, but rather pthread_join) share|improve this answer edited Jan 3 '12 at 0:39 answered Jan 3 '12 at 0:33 kamziro 2,27542859 4 If you're not interested in waiting on the thread, a pthread_detach() should do the same as far as releasing resources
text] pthread_create is failing with a return value EAGAIN From: "Prasad A
Pthread_create_detached
Tunga"
PTHREAD_CREATE(3) NAME top pthread_create - create a new thread SYNOPSIS top #include
appear in the logs. The whole system can get unresponsive and the Intelligence Server cannot be started anymore. Error in DSSErrors.log: System Error (EAGAIN): --- Resource temporarily unavailable pthread_create failed CAUSE: This error is an operating system-level error. The issue involves the creation of process threads or pthreads.There may be insufficient pthreads to allow the Intelligence Server to spawn network and database connections. How high can the value for the 'Number of connection by priority' be set? If the value should be changed and a very high number is entered, there is a warning message appearing, however a number as high as 500 or even 999 can be entered without issues. However whether such a high number is acceptable is entirely environment specific and needs to be discussed with the system administrator. How many threads is the Intelligence server using? The Intelligence Server has 121 threads without any project loaded. Once a single project is loaded, there are the following additional threads: 1x Cache backup task 2x Statistic threads (if statistics are enabled) Multiple warehouse threads depending on the amount of database instances checked in the Project Configuration and the amount of threads specified in the job priority tab. Please note the following example: In the Tutorial Project, normally there tends to be 5 database instances checked. The default thread count by job priority is: 2 low, 2 medium, 2 high Adding the threads together (6) and multiplying them by the checked database instances (5), would result in 30 threads. Based on the above, there is a great potential for large amounts of threads, especially if the number is set to as high as for example 500 or even 999 in an environment. It is therefore important to contact the system administrator to check the thread or pthread count before increasing this value to a very high number in order to make sure that the system is able to handle it. Did this article solve your problem? Yes No (404 Views) TN219759: Error: “System Error (EAGAIN): --- Resource temporarily unavailable pthread_create failed” after setting the value of '