2

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.

2 Answers2

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

To run 15 instances simultaneously in a bourne compatible shell:

   for i in $(yes | sed 15q); do ./test.exe & done
  • it says "i was unexpected at this time." –  Mar 20 '14 at 23:36
  • @fmvpsenior Given that you stated you were using cmd, that would imply you are not using bash. Also note this answer is only relevant in an environment where sed is also installed. – Jason C Mar 20 '14 at 23:36