多个系统()调用在不同的线程/进程中工作吗


Does multiple system() calls works in different thread/processes?

我试图在4个线程/进程中运行我的phantomjs脚本。其想法是使用不同的参数异步运行它。所以我做了一些类似(循环)的事情:

$arguments = array('argument1', 'argument2', 'argument3');
foreach($arguments as $argument){
    system('phantomjs my_script.js ' . $argument . ' > output_for_' . $argument . ' 2> errors_for_' . $argument . ' &');
}

phantomjs实例会异步工作吗?还是不?

编辑:顺便说一句,我知道这是非阻塞系统调用,php脚本会继续执行,但我不确定php system()调用的每个phantomjs实例是否与另一个phantomjs实例异步。

不,system()本身不会生成新的进程或线程。