P
Peter
Hi
Is there a simple tool I can use to test how two threads using the same
instance of a class would react? For example, I would like to manually
control two threads stepping through the below code to see the states
of the threads (and the list in MyClass) if the threads share the same
MyClass instance.
My guess is that it would be possible for the below class to return
different List instances to each thread.
public class MyClass
{
private List<string> aList;
public List<string> AList
{
get
{
if (aList == null)
{
aList = new List<string>();
}
return aList;
}
}
}
Is there a simple tool I can use to test how two threads using the same
instance of a class would react? For example, I would like to manually
control two threads stepping through the below code to see the states
of the threads (and the list in MyClass) if the threads share the same
MyClass instance.
My guess is that it would be possible for the below class to return
different List instances to each thread.
public class MyClass
{
private List<string> aList;
public List<string> AList
{
get
{
if (aList == null)
{
aList = new List<string>();
}
return aList;
}
}
}