나는 "글로벌"데이터를 유지하는 내 ASP MFC 응용 프로그램의 클래스가 있습니다. 그것은 싱글 톤으로 구현됩니다.C# asp mvc 싱글 톤 가비지 수집
lock (InfoStrings.GetMe())
{
...
}
좋아,이 질문 : :이처럼에 잠이 클래스에 액세스 컨트롤러의 코드에서 이제
class InfoStrings
{
public List<string> strings = new List<string>();
static InfoStrings me = null;
private InfoStrings()
{ }
public static InfoStrings GetMe()
{
if(me == null)
me = new InfoStrings();
return me;
}
}
: 그것은 다음과 같이 보입니다 할 수있는, 이론적으로)
1 내 InfoStrings
개체가 가비지 수집됩니까?
2) 적절한 잠금을하고 있습니까?