Execute Process Chain

后端 未结 2 1241
半阙折子戏
半阙折子戏 2021-01-13 18:48
  public void ExecuteProcessChain(string[] asProcesses, string sInRedirect, string sOutRedirect)
    {
            Process p1 = new Process();
            p1.StartIn         


        
2条回答
  •  佛祖请我去吃肉
    2021-01-13 19:19

    Why not use threading?

    Consider this: Put each calc into a thread and then start them both. After that make the program wait for them. Only after both threads are done with their jobs (read data) then you can continue.

    Remember that threads cannot directly alter data from another thread so I might suggest the use of Invoke or static variables, depending on what you might need.

    If possible, you can make use of Task/Parallel library which already have some useful methods to help you on this.

    Background Worker is too a way to go.

提交回复
热议问题