外壳工艺的并行执​​行 [英] Parallel execution of shell processes

查看:146
本文介绍了外壳工艺的并行执​​行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可用的工具并行的Windows批处理文件执行多个程序?我已经发现了一些有趣的工具用于Linux(平行并的 PPSS ),但是,我需要为Windows平台的工具。

Is there a tool available to execute several process in parallel in a Windows batch file? I have found some interesting tools for Linux (parallel and PPSS), however, I would need a tool for Windows platforms.

奖励:这将是巨大的,如果该工具还允许以一种简单的方式多台计算机之间分配过程中,远程运行的进程一拉的 PSEXEC

Bonus: It would be great if the tool also allowed to distribute processes in an easy way among several machines, running the processes remotely a la PsExec.

例如:我想,在for循环以下

Example: I would like that in the following for loop

for %F in (*.*) do processFile.exe %F

processFile.exe的情况下,有限数量的并行运行,以充分利用多核CPU的。

a limited amount of instances of processFile.exe are running in parallel to take advantage of multi-core CPUs.

推荐答案

在Linux下GNU的xargs有着-P N开关,推出N的进程并行。

GNU xargs under Linux has a "-P n" switch to launch "n" processes in parallel.

也许cygwin的/ MinGW的建设的xargs也支持这一点?

Maybe cygwin/mingw build of xargs also supports this?

然后你可以使用:

xargs -P 4 processFile < fileList

没有花哨的多节点的过程产卵,虽然。

No fancy multi-node process spawning, though.

这篇关于外壳工艺的并行执​​行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆