Re: can an instance method be thread safe
- From: "Nicholas Paldino [.NET/C# MVP]" <mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 24 May 2006 13:53:43 -0400
Mike,
Not completely. Since you are accessing this.Name, that needs to be
thread safe. If access to this.Name is thread safe, then in this case, yes,
this is thread safe.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mvp@xxxxxxxxxxxxxxxxxxxxxxxxxxx
"miked" <miked@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:685FE0B1-A0ED-432A-965C-29500E916AF9@xxxxxxxxxxxxxxxx
If an instance method does not alter the containing class or any arguments
of
a referenced type is it thread safe?
public void GetSomething() {
return new Something(this.Name);
}
public string Name;
Thanks,
Mike
.
- Prev by Date: DLL protection
- Next by Date: Re: pushing the envelope with sockets
- Previous by thread: DLL protection
- Next by thread: Re: can an instance method be thread safe
- Index(es):