max thread per process in linux

后端 未结 5 1083
情书的邮戳
情书的邮戳 2020-12-25 08:54

I wrote a simple program to calculate the maximum number of threads that a process can have in linux (Centos 5). here is the code:

int main()
{
    pthread_t         


        
5条回答
  •  醉梦人生
    2020-12-25 09:39

    Your system limits may not be allowing you to map the stacks of all the threads you require. Look at /proc/sys/vm/max_map_count, and see this answer. I'm not 100% sure this is your problem, because most people run into problems at much larger thread counts.

提交回复
热议问题