473,395 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Thread safe - What does it mean?

Ant
Hi,

I'm wondering what this exactly means when I see it describing class in MSDN.

"Any instance members are not guaranteed to be thread safe."

What does this mean exactly & how could an "un thread safe" instance affect
an application.

Sorry for what may be a very simple question but i thought i'd get this
cleared up.

Many thanks for any answers
Ant

May 25 '06 #1
3 2629
Hello, Ant!

A> I'm wondering what this exactly means when I see it describing class in
A> MSDN.

A> "Any instance members are not guaranteed to be thread safe."

A> What does this mean exactly & how could an "un thread safe" instance
A> affect an application.

A> Sorry for what may be a very simple question but i thought i'd get this
A> cleared up.

http://en.wikipedia.org/wiki/Thread-safe

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
May 25 '06 #2
Ant
Just a thought...

Would it be analaogous to say in database terms, where a transaction can be
read multiple times but if it's not set to seralizable, various reads by
different 'threads' could take place & return different values if the data
had been updated by another thread?

Ant

"Ant" wrote:
Hi,

I'm wondering what this exactly means when I see it describing class in MSDN.

"Any instance members are not guaranteed to be thread safe."

What does this mean exactly & how could an "un thread safe" instance affect
an application.

Sorry for what may be a very simple question but i thought i'd get this
cleared up.

Many thanks for any answers
Ant

May 25 '06 #3
Ant,

Yes, but that's just one of many possibilities. The effects are mostly
unpredicatable and are usually difficult to diagnose and fix.

I recommend reading the following multipage articles on threading.

<http://www.yoda.arachsys.com/csharp/threads/index.shtml>
<http://www.albahari.com/threading>

Brian

Ant wrote:
Just a thought...

Would it be analaogous to say in database terms, where a transaction can be
read multiple times but if it's not set to seralizable, various reads by
different 'threads' could take place & return different values if the data
had been updated by another thread?

Ant

"Ant" wrote:
Hi,

I'm wondering what this exactly means when I see it describing class in MSDN.

"Any instance members are not guaranteed to be thread safe."

What does this mean exactly & how could an "un thread safe" instance affect
an application.

Sorry for what may be a very simple question but i thought i'd get this
cleared up.

Many thanks for any answers
Ant


May 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Frank Rizzo | last post by:
Some of the classes in the framework are marked as thread-safe in the documentation. In particular the docs say the following: "Any public static (*Shared* in Visual Basic) members of this type...
11
by: dee | last post by:
OleDbCommand class like many .NET classes has the following description in its help file: "Thread Safety Any public static (Shared in Visual Basic) members of this type are safe for...
15
by: Laser Lu | last post by:
I was often noted by Thread Safety declarations when I was reading .NET Framework Class Library documents in MSDN. The declaration is usually described as 'Any public static (Shared in Visual...
13
by: Laser Lu | last post by:
I was often noted by Thread Safety declarations when I was reading .NET Framework Class Library documents in MSDN. The declaration is usually described as 'Any public static (Shared in Visual...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.