Each method invocation will have a separate set of local variables. However, those variables could refer to objects which other methods also use. For example:
public void AppendSomething(StringBuilder builder)
{
builder.Append("Something");
}
Here builder
is still a local variable (parameters are local variables) and each invocation of AppendSomething
will have an independent variable - but you could call the method from multiple threads using the same StringBuilder
reference, so that method is not thread-safe. (As StringBuilder
isn't thread-safe.)