Create multiple threads and wait all of them to complete

前端 未结 8 1989
星月不相逢
星月不相逢 2020-12-02 15:13

How can I create multiple threads and wait for all of them to complete?

8条回答
  •  余生分开走
    2020-12-02 15:57

    In .NET 4.0, you can use the Task Parallel Library.

    In earlier versions, you can create a list of Thread objects in a loop, calling Start on each one, and then make another loop and call Join on each one.

提交回复
热议问题