P
paul.hester
Hi all,
All of the classes in my DAL are static, with constants defining the
stored procedures and parameters. I've been having some problems with
my site which makes me wonder if there's a thread safety issue.
Are consts thread safe? Would the following example create any thread
safety issues? Would you recommend using static readonly members
instead of constants?
public static class Test
{
private const string TEST_ME = "test";
public static void DoSomething()
{
AnotherStaticClass.DoSomethingElse(TEST_ME);
}
}
Thanks,
Paul
All of the classes in my DAL are static, with constants defining the
stored procedures and parameters. I've been having some problems with
my site which makes me wonder if there's a thread safety issue.
Are consts thread safe? Would the following example create any thread
safety issues? Would you recommend using static readonly members
instead of constants?
public static class Test
{
private const string TEST_ME = "test";
public static void DoSomething()
{
AnotherStaticClass.DoSomethingElse(TEST_ME);
}
}
Thanks,
Paul