.net thread safety

Posted by george9170 on Stack Overflow See other posts from Stack Overflow or by george9170
Published on 2010-04-02T13:23:17Z Indexed on 2010/04/02 13:33 UTC
Read the original article Hit count: 578

Filed under:
|

Why is locking a type considered very bad? For example, lock(typeof(DateTime)) I understand that static methods of any class in .net is considered thread safe, and that instance members are not. So it isn't necessary to lock DateTime while you are using it. The book I am reading doesn't explain why it is bad it just says it is. Any explanation will be great.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about thread-safety