news
Thu Oct 23 13:18:04 CDT 2003
I know about threading, just not how C# would treat it with regard to an
object method being started as a thread and that method sitting in an object
etc. basically as I see it only that method is in a thread and the variables
local to that method are in that thread but the rest is shared, so how would
a static method be different if any?
"Jon Skeet [C# MVP]" <skeet@pobox.com> wrote in message
news:MPG.1a0210c07308547e98991c@msnews.microsoft.com...
> news.microsoft.com <anonymouse@discussions.microsoft.com> wrote:
> > If I have an object taht has a method thats started as a tread and
other
> > methods that are called by other classes.
> > WHat is the boundries? The methods called by other claseses are in
one
> > thread and the threadproc in another, so we must sync those objects taht
are
> > being shared between the called methods and the thread proc? Right?
> >
> > SO basically the object itself is sitting in the caller thread, yet the
> > threadproc inside the object is in another. so its feet in both threads?
>
> Objects don't "sit" in threads at all. I'm not sure what you mean by
> this. If data needs to be shared between threads, you need to
> synchronize in order to make sure that the most up-to-date version is
> seen, and to avoid race conditions etc.
>
> --
> Jon Skeet - <skeet@pobox.com>
>
http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too