Alex Rivera | Logout

Why is List<T> not thread-safe?

Asked 2009-04-01T03:49:57.127
44

From the following site:

http://crfdesign.net/programming/top-10-differences-between-java-and-c

Unfortunately, List<> is not thread-safe (C#’s ArrayList and Java’s Vector are thread-safe). C# also has a Hashtable; the generic version is:

What makes List<T> not thread-safe? Is it implementation problem on .NET framework engineer's part? Or are generics not thread-safe?

Edit
Report

1 Answer

0

use SynchronizedCollection it also provides a Constructor-Parameter to use a shared sync :)

answered 2010-01-29T12:39:48.160

Your Answer