Need help. Unable to create threads after a certain number

Hi,

I have a process which creates pthreads to generate some reports. After creating the reports these threads return null. But after 1024 threads, the process is not able to create any threads further.,and at max 5 threads are existing simultaneously and are returning the control back after they have created the reports.

>shud i cleanup any resources explicitly if it is not being done.

>is this a normal behaviour

I thought there is only a limitation on maximum threads existing simultaneously.

Thanks in advance

Try:
/usr/sbin/kmtune | grep max_thread_proc

ah! the problem is resolved. pthread by default was spawning in joinable state which made it not to release the resources it consumed until a pthread_detach call was made. I modified the pthread_attr to create thread in detach state. Now i am able to create any number of threads.

Thanks
KK