Operating System - HP-UX
1757931 Members
2844 Online
108866 Solutions
New Discussion юеВ

Error during thread creation.

 
SOLVED
Go to solution
Saurav Narain
Occasional Contributor

Error during thread creation.

Hi All,
We are working on a multi threaded application on an HPUX machine. After creating n (i call it n because its variable) number of threads (not running simultaneously) the pthread_create returns an error (ENOMEM), no memory available.

At a time there are maximum 10 threads running simultaneously. That is guaranteed. How ever the application brings up threads (maximum 10) as an when the load on the application increases.

From limits.h
/*
* number of threads per process
*/
# define _POSIX_THREAD_THREADS_MAX 64

What could be causing this error and how do we rectify it? Will compiling the code as a 64 bit executable help?

Thanks,
Saurav.
2 REPLIES 2
RAC_1
Honored Contributor

Re: Error during thread creation.

Check your kernel settings.

max_thread_proc and nkthread

Also, check, ulimit -Sa and ulimit -Ha befire you start your apps.
There is no substitute to HARDWORK
Alessandro Pilati
Esteemed Contributor
Solution

Re: Error during thread creation.

Saurav,
check also your application, for thread allocation.

this link may be useful:
http://h21007.www2.hp.com/dspp/tech/tech_TechSingleTipDetailPage_IDX/1,2366,150,00.html

Regards,
Alex
if you don't try, you'll never know if you are able to