I can not start more than 100 processes

I have a huge number of shell commands executed with root / admin privileges through an Authorization Services call "AuthorizationExecuteWithPrivileges". The problem is that after a while (10-15 seconds, maybe 100 shell commands), the program stops responding to this error in the debugger:

can not develop: errno 35

And then, while the application is running, I can not run more applications. I investigated this problem, and apparently this means that there are no more threads for the system. However, I checked the use of Activity Monitor, and my application uses only 4-5 threads.

To solve this problem, I think that I need to make separate shell commands in a separate thread (away from the main thread). I have never used threads before, and I'm not sure where to start (no comprehensive examples that I could find)

thanks

+3
source share
2 answers

As Louis Herbargh has already pointed out, your question has nothing to do with threads. I edited your title and tags accordingly.

I have a huge number of shell commands executed with root / admin privileges through an Authorization Services call "AuthorizationExecuteWithPrivileges".

. , root: admin owner setuid , root.

, , root , root, , , ( setuid), , , ( setuid).

.

, (10-15 , , 100 ) :

couldn't fork: errno 35

. . , .

, , , , . . limit limit -h ( zsh; ).

, .

, , .

, . - , .

, , , , .

, .

errno . EAGAIN (35, " " ) , , , .

, fork, , . EAGAIN " , ". . fork.

Activity Monitor, 4-5 .

?

, , ( ).

.

...

, , , , , .

+7

( , ). . 1 (, ), vnodes . .

, , . , . mecahanisms, sysctls. , , () , , , .

, . , , , . , , , .

+3

All Articles