[英]Multiple GNU Octave Instances
I've searched to try and find the answer to this question, but unfortunately, information is few and far between. 我已经搜索尝试找到该问题的答案,但是不幸的是,信息很少。
I need to be able to open multiple instances of GNU Octave to run a script which will convert a file. 我需要能够打开GNU Octave的多个实例来运行将转换文件的脚本。 Each file takes approximately 5 minutes to convert, so for 10 files I'm waiting nearly 50 minutes. 每个文件大约需要5分钟才能转换,因此对于10个文件,我正在等待近50分钟。
However, I can (and have) manually open 10 instances of Octave and run the script manually in each instance. 但是,我可以(并拥有)手动打开10个Octave实例,并在每个实例中手动运行脚本。 Is there a way to do this programmatically? 有办法以编程方式执行此操作吗? So if I had 10 files, 10 different instances of Octave would open and each would run the script to convert 1 file. 因此,如果我有10个文件,则将打开10个不同的Octave实例,每个实例将运行脚本以转换1个文件。 These conversions aren't dependent on each other, but if it's simple enough to communicate between the different instances of Octave, that would be a "nice to know". 这些转换并不相互依赖,但是如果在八度音阶的不同实例之间进行通信足够简单,那将是一个“不错的认识”。
I believe you can use some of the high-level commands, like system
and popen
which Octave include for starting subprocesses. 我相信您可以使用Octave包含的一些高级命令来启动子流程,例如system
和popen
。 These subprocesses allow you to start new tasks or start another program. 这些子过程使您可以启动新任务或启动另一个程序。 After performing the tasks it can observe the output, which is a way to communicate with the main program that starts the subprocesses. 执行任务之后,它可以观察输出,这是与启动子流程的主程序进行通信的一种方式。
You should take a look at the following reference page , which covers the different approaches. 您应该查看下面的参考页 ,其中涵盖了不同的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.