ConcurrentBag Vs List

后端 未结 5 1379
粉色の甜心
粉色の甜心 2020-12-08 15:18

What is the advantage of using a ConcurrentBag(Of MyType) against just using a List(Of MyType)? The MSDN page on the CB states that

ConcurrentBag(Of

5条回答
  •  遥遥无期
    2020-12-08 15:51

    I think you should read that as "where multiple threads access the container and each thread may both produce and/or consume data", it is definitely intended for parallel scenarios.

提交回复
热议问题