Re: Should we always call EndInvoke()?
- From: beginwithl@xxxxxxxxx
- Date: Mon, 2 Feb 2009 17:08:57 -0800 (PST)
hi
On Feb 3, 5:12 am, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
On Mon, 02 Feb 2009 15:46:12 -0800, <beginwi...@xxxxxxxxx> wrote:
I wasn’t asking about thread safe instances, but more about thread
safe static .Net members. Just like your regular, non-god like
programmer has to make sure that all the different thread-safe
members belonging to different classes have to access same resource in
some synchronized way, I thought the creators ( demigods :D ) of Net
library also made sure that static members from different classes
accessed same resource in some synchronized manner
I have never heard of a class that documents itself as "thread-safe" with
respect to some _other_ class. Not that classes couldn't share resources,
but it's unusual enough for them to do so as it is, never mind for two or
more classes to claim thread-safety with each other.
One of the points of object-oriented programming is to isolate
implementation details within a class. When that's done, different
classes are automatically thread-safe with respect to each other, because
they don't interact with each other in a thread-unsafe way.
Despite the ability of classes to isolate implementation details,
there is still possibility of different classes ( those defined in Net
library) trying to operate on same resource at the same time, and if
OS doesn’t synchronize them somehow, then wouldn’t it be possible for
data to get corrupted ( I’m assuming that’s what you meant with the
term “interact with each other in a thread-unsafe way” ) … in other
words, classes would interact with each other in a thread-unsafe way?!
cheers
.
- Follow-Ups:
- Re: Should we always call EndInvoke()?
- From: Peter Duniho
- Re: Should we always call EndInvoke()?
- References:
- Re: Should we always call EndInvoke()?
- From: beginwithl
- Re: Should we always call EndInvoke()?
- From: Peter Duniho
- Re: Should we always call EndInvoke()?
- From: beginwithl
- Re: Should we always call EndInvoke()?
- From: Peter Duniho
- Re: Should we always call EndInvoke()?
- From: beginwithl
- Re: Should we always call EndInvoke()?
- From: Peter Duniho
- Re: Should we always call EndInvoke()?
- From: beginwithl
- Re: Should we always call EndInvoke()?
- From: Peter Duniho
- Re: Should we always call EndInvoke()?
- Prev by Date: Re: Why could a suspended thread leak?
- Next by Date: Re: c# call virtual/abstruct function from the constructor of the base class
- Previous by thread: Re: Should we always call EndInvoke()?
- Next by thread: Re: Should we always call EndInvoke()?
- Index(es):
Relevant Pages
|