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:
00961800
Vues:
5
David,
So does that mean that a non-static member can be made just as thread-safe as a static member?
I guess I need to read some more about threads in .NET, do you know of any good books or articles about threads and thread-safety?

Einar

>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?
>>
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform