php - 多个 system() 调用是否在不同的线程/进程中工作?

标签 php linux phantomjs

我正在尝试在 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() 本身不会产生新的进程或线程。

关于php - 多个 system() 调用是否在不同的线程/进程中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25639150/

相关文章:

php - 如何使用简单的PHP代码在浏览器上调用和显示DWG文件

php - 哪个最不密集 - 在 PHP 或 MySQL 中计算唯一时间?

javascript - 在 Yii2 中使用 Clipboard.js

python - 导入 ctypes.wintypes 时出错

phantomjs - 如何在 Phantomjs 中使用 luminati.io

javascript - Jasmine/PhantomJS 忽略 __defineGetter__ 方法

jquery - html-pdf : css and js files do not appear to be processing

php - 如何在 php 中定义自定义数字基数?

linux - linux命令的内部工作

c - 当我拔下串行电缆时,Linux read() 调用不返回错误