The following is a description of the maximum number of threads that can be used in a process in a Linux environment.
Main thread + worker thread +<253 One of its own threads <=255
Contains the main thread and a worker threads, up to 255, that is, you can only generate 253 threads yourself.
It is said that you can set the number of threads:
It is said to be able to set, but I have not verified! I don't know if I can.
Type the limit command in your shell, with the number of descriptor in it, which is the maximum number of threads your process can create. You can change this number by modifying the kernel file.