Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thread safety: is my thread safe?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00961688
Message ID:
00961792
Vues:
4
No! Just making a member static does not make it thread safe!!!!! What that blurb in the docs means is that Microsoft has added the necessary code to the static members of the class to make them thread safe.

Basically, you can use the lock operator in c# or Monitor.Enter to make your class thread safe.

>Thread Safety
>Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.
>
>I have seen this for several classes in the help documentation, but what does it acctually mean. Why is it so important to use static members in a muti-threaded environment?
>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform