How to clear the ConcurrentBag? it don't have any method like Clear or RemoveAll...
ConcurrentBag
Clear
RemoveAll
Although it might not completely clear due to a potential race condition, this is sufficient:
while (!myBag.IsEmpty) { myBag.TryTake(out T _); }