locked
Running multiple instances RRS feed

  • Question

  • I would like to achieve the following:

    Run 2 instances of an application and wait for their completion.
    Run 4 instances of an application and wait for their completion.
    Run 8 instances of an application and wait for their completion.

    All this needs to be executed from the application itself. 

    How do I do this?

    ajaind
    Saturday, January 30, 2010 5:11 PM

Answers

  • CreateProcess and GetExitCodeProcess should be the tools you can use to get this done.



    • Marked as answer by Wesley Yao Friday, February 5, 2010 2:59 AM
    Saturday, January 30, 2010 5:16 PM
  • ajaind wrote:
    > As far as I know, CreateProcess will create a process in the same command window. I would like to spawn independent instances of
    > the same application with different command line options.
    CreateProcess takes a number of parameters. One of these is the command line to pass to the new process. Another is a set of flags, one of which tells the system to allocate a separate console for that process.
    --
    Igor Tandetnik
    • Marked as answer by Wesley Yao Friday, February 5, 2010 2:59 AM
    Saturday, January 30, 2010 9:02 PM

All replies

  • CreateProcess and GetExitCodeProcess should be the tools you can use to get this done.



    • Marked as answer by Wesley Yao Friday, February 5, 2010 2:59 AM
    Saturday, January 30, 2010 5:16 PM
  • As far as I know, CreateProcess will create a process in the same command window. I would like to spawn independent instances of the same application with different command line options.
    ajaind
    Saturday, January 30, 2010 5:22 PM
  • ajaind wrote:
    > As far as I know, CreateProcess will create a process in the same command window. I would like to spawn independent instances of
    > the same application with different command line options.
    CreateProcess takes a number of parameters. One of these is the command line to pass to the new process. Another is a set of flags, one of which tells the system to allocate a separate console for that process.
    --
    Igor Tandetnik
    • Marked as answer by Wesley Yao Friday, February 5, 2010 2:59 AM
    Saturday, January 30, 2010 9:02 PM