Is Task.Factory.StartNew() guaranteed to create at least one new thread?

前端 未结 6 1999
一生所求
一生所求 2021-01-24 14:38

I understand that the TPL does not necessarily create a new thread for every task in a parallel set, but does it always create at least one? eg:

private void MyF         


        
6条回答
  •  耶瑟儿~
    2021-01-24 15:24

    In short: Yes, this is guranteed.

    Longer: If StartNew() does not create a new thread, it will reuse another: Either by it being free, or by queueing.

提交回复
热议问题