I'm not sure I agree with the last statement. Static methods can only access
static data members (right?), and the latter can not be implemented on a stack
because then they wouldn't be shared.
So, it must be that the class implementor knows that the static data members
are accessed using a monitor or some other mechanism that ensures thread
safety, no?
"Bonj" wrote:
> By members, it means methods. i.e. if you intend to call the same method of
> the same *object* from two threads, you need to provide synchronisation. If
> you only intend to call two static methods of the same *type* from different
> threads, then you probably won't need to provide synchronisation as all the
> data will be largley stack based.
>
> "Fekkai" wrote:
>
> > I have a question about threads:
> > In the TCPClient help page I find the following explanation
> >
> > "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."
> >
> > What does it mean, I need an example of something that is not safe.
> >
> > Tia
> >
|