please explain

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey all,

i was wondering when you lookup commands in MSDN help in the description
you'll often see it say that it's threadsafe or not. i know kinda what a
thread is (needle and thread right? j/k :) no i really know a little about
threads, but in lamen terms what does threadsafe mean?

thanks,
rodchar
 
You know that 2 threads can cause problems when trying to modify the same
variable at the same time, or calling the same method which internally
modifies variables, etc. since they must lock the access before modifying.
The documentation specifies which methods are threadsafe, that is, which
methods can be called safely from a thread without writing locking
statements before making the call in the code of the thread. Normally only
static methods are safe-thread since they are stateless (kind of self
contained), while instance-methods can modify member variables of the class.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
thanks this helped.

Carlos J. Quintero said:
You know that 2 threads can cause problems when trying to modify the same
variable at the same time, or calling the same method which internally
modifies variables, etc. since they must lock the access before modifying.
The documentation specifies which methods are threadsafe, that is, which
methods can be called safely from a thread without writing locking
statements before making the call in the code of the thread. Normally only
static methods are safe-thread since they are stateless (kind of self
contained), while instance-methods can modify member variables of the class.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
Well, just to be correct the phrase:

" modifies variables, etc. since they must lock the access before modifying.
"

should read

" modifies variables, etc. so you must must lock the access in your code
before modifying. "

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top