Groups | Blog | Home
all groups > dotnet faqs > october 2004 >

dotnet faqs : What is thread safety?


Hans
10/11/2004 10:14:50 AM
Is there anyone can explain "thread safety" in detail for me please?

Sahil Malik
10/12/2004 11:15:03 AM
A peice of code is deemed thread safe, if it can be called from multiple
threads without unwanted/unexpected interaction.

This involves a lot of weird issues you have to field in a multi threaded
world. Re-entrancy problems, variables being changed unexpectedly etc. are
some examples. Certain standard programming techniques like statics become
really interesting in making a class threadsafe.

Another related topic is Thread Affinity. And hence they say, for anything
to enlist in MTS, it has to be both thread safe and not have thread
affinity. (ok I'm rambling now).

- Sahil Malik
You can reach me thru my blog at
http://www.dotnetjunkies.com/weblog/sahilmalik



[quoted text, click to view]

AddThis Social Bookmark Button