Question: I want an implementation of `List<T>` as a property which can be used thread-safely without any doubt.

Something like this:

```
private List<T> _list;

private List<T> MyT
{
    get { // return a copy of _list; }
    set { _list = value; }
}

```

It seems still I need to return a copy (cloned) of collection so if somewhere we are iterating the collection and at the same time the collection is set, then no exception is raised.

How to implement a thread-safe collection property?

Answer: 
Even accepted answer is ConcurrentBag, I don't think it's real replacement of list in all cases, as Radek's comment to the answer says: "ConcurrentBag is unordered collection, so unlike List it does not guarantee ordering. Also you cannot access items by index".

So if you use .NET 4.0 or higher, a workaround could be to use **ConcurrentDictionary** with integer TKey as array index and TValue as array value. This is recommended way of replacing list in Pluralsight's [C# Concurrent Collections course](https://www.pluralsight.com/courses/csharp-concurrent-collections). ConcurrentDictionary solves both problems mentioned above: index accessing and ordering (we can not rely on ordering as it's hash table under the hood, but current .NET implementation saves order of elements adding).
It seems like many of the people finding this are wanting a thread safe indexed dynamically sized collection. The closest and easiest thing I know of would be.

```
System.Collections.Concurrent.ConcurrentDictionary<int, YourDataType>

```

This would require you to ensure your key is properly incremented if you want normal indexing behavior. If you are careful `.count()` could suffice as the key for any new key value pairs you add.