K
ks_lon
Hello all,
I was developing an ASP.NET application using c#, and I was thinking
for adding some instance variables for my xyz.aspx like this :-
public class SetCustomers : System.Web.UI.Page
{
private string s_workemail = "";
private void Page_Load(object sender, System.EventArgs e)
{
I however came across this in the Page Class definition :-
Thread Safety
Any public static (Shared in Visual Basic) members of this type are
thread safe. Any instance members are not guaranteed to be thread safe.
so I got confused, my question is, does this mean that my instance
variable s_workemail is NOT thread safe?
i.e if user A and user B access my page and modify the value at the
same time, will I get wrong results? or will there be 2 variables, 1 on
every thread?
Thanks for your help.
I was developing an ASP.NET application using c#, and I was thinking
for adding some instance variables for my xyz.aspx like this :-
public class SetCustomers : System.Web.UI.Page
{
private string s_workemail = "";
private void Page_Load(object sender, System.EventArgs e)
{
I however came across this in the Page Class definition :-
Thread Safety
Any public static (Shared in Visual Basic) members of this type are
thread safe. Any instance members are not guaranteed to be thread safe.
so I got confused, my question is, does this mean that my instance
variable s_workemail is NOT thread safe?
i.e if user A and user B access my page and modify the value at the
same time, will I get wrong results? or will there be 2 variables, 1 on
every thread?
Thanks for your help.