From b1b110858312fcfe66c701f47d60a55f7918c18a Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Wed, 22 Oct 2014 19:07:04 +0200 Subject: [PATCH] bochs-experiment-runner: -j option for parallel operation Change-Id: I29e659da0892fdcfc170dccafa5917593e22776a --- .../bochs-experiment-runner.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/bochs-experiment-runner/bochs-experiment-runner.py b/tools/bochs-experiment-runner/bochs-experiment-runner.py index d8f97596..eca00f2a 100644 --- a/tools/bochs-experiment-runner/bochs-experiment-runner.py +++ b/tools/bochs-experiment-runner/bochs-experiment-runner.py @@ -28,6 +28,10 @@ def parseArgs(): action="store_false", dest="forever", default=True, help="fail-client to be executed") + parser.add_option("-j", "--jobs", + dest="jobs", default="1", + help="parallel execution") + (options, args) = parser.parse_args() @@ -108,6 +112,14 @@ i440fxsupport: enabled=0, slot1=pcivga if __name__ == "__main__": (options, args) = parseArgs() + + import thread + i = 1 + # n-1 jobs in threads + while i < int(options.jobs): + thread.start_new_thread(main, (options, args)) + i = i + 1 + main(options, args)