I have an executable (e.g. test.exe) that is compiled c++/cli that can support multi threads. How can I run that same executable multiple times in parallel? The easiest way is to open several cmd windows and run test.exe from there, but that's probably no the fastest or easiest way do it.
Asked
Active
Viewed 5,129 times
2 Answers
4
On windows you can use
start /B <executable>
This will run the process in the background, giving back a prompt, much like bash &
--- EDIT ---
And to run a predifined number of processes, you could use FOR:
FOR %i IN (1 2 3 4 5) DO start /B <executable>
NewbiZ
- 268
-
-
1@fmvpsenior Type
start /?and see, or read the documentation forstart. – Jason C Mar 20 '14 at 23:38 -
1
-
@fmvpsenior The cops don't have any jurisdiction here and it seems like a lot of training to go through just to tell you what everybody else already knows about asking questions on the internet. – Jason C Mar 21 '14 at 00:00
1
To run 15 instances simultaneously in a bourne compatible shell:
for i in $(yes | sed 15q); do ./test.exe & done
William Pursell
- 1,593
-
-
@fmvpsenior Given that you stated you were using
cmd, that would imply you are not usingbash. Also note this answer is only relevant in an environment wheresedis also installed. – Jason C Mar 20 '14 at 23:36