I do not know the inner workings of php exec() but I like to know if it create processes or threads for execution of external command.
Asked
Active
Viewed 277 times
1
-
You might take a look at the source code http://lxr.php.net – HamZa Dec 09 '14 at 11:56
-
from the PHP man page it seems like at least on some operating systems it's a process, but of course this is implementation-specific. Can you say which OS you are interested in? – RobP Dec 09 '14 at 11:58
-
Ah, [this](http://lxr.php.net/xref/PHP_5_5/ext/standard/exec.c#82) indicates that it creates a new process – HamZa Dec 09 '14 at 11:59
2 Answers
2
When you call exec php does not create a thread, it creats a new child process. more information here PHP exec() performance
0
It has to be a process. You can't launch a new shell in a thread. Threads are delineations of a single process: you cannot start a new program without creating a new process.

Lightness Races in Orbit
- 378,754
- 76
- 643
- 1,055