I have a main thread that populates a List
. Further I create a chain of objects that will execute on different threads, requiring access to the List. The
If you are certain that the list will not be modified after creation, you should guarantee that by converting it to a ReadOnlyCollection
From the Thread Safety section of the collection:
A ReadOnlyCollection can support multiple readers concurrently, as long as the collection is not modified.
So if you don't touch the original list again and stop referencing it, you can ensure that multiple threads can read it without worry (so long as you don't do anything wacky with trying to modify it again).