Microsoft MVP성태의 닷넷 이야기
Don't Lock Type Objects! - lock( typeof( SomeClass ) ); [링크 복사], [링크+제목 복사],
조회: 9097
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 

저도 static 자료에 대한 동기화를 하려 할 때 가끔 썼던 방법인데... ^^;
실제로, 저 역시 static 에 대한 동기화를 위해서 lock( typeof( SomeClass ) ); 와 같은 표현을 봤었습니다.

어쨌든, 이제라도 바로 잡아야 겠습니다.

Why Lock(typeof(ClassName)) or SyncLock GetType(ClassName) Is Bad
; http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui06032003.asp

결론은, static 자료에 대한 동기화를 위해 별도의 private static 참조 데이터를 생성해서 쓰거나, 기존에 정의되어 있다면 그것을 쓰라는.








[최초 등록일: ]
[최종 수정일: 4/14/2006]


비밀번호

댓글 작성자
 




... 31  32  33  34  35  36  37  38  39  40  [41]  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
160정성태4/13/20069424MS 인증서버 : 인증서 유효 기간 기본값 변경
157정성태4/13/20069038Converting a managed PDB into a XML file
158정성태4/13/20068691    답변글 [추가]: A SymWriter sample is coming...
156정성태4/13/20069490Method Call Interception (MCI) in C++
155정성태4/13/20068900Web Project Conversion Wizard
154정성태12/21/20059626Interprocess Communication Using the Running Object Table (ROT)파일 다운로드1
153정성태4/13/20069115Assembly loading failure is expensive [1]
152정성태4/13/20069703ASCX 컨트롤을 커스텀 컨트롤로 사용하는 방법.
151정성태4/13/20068526TechNet 세미나 목록
150정성태4/13/20068691SCDL Tool [2]
149정성태4/13/20068776Disk (based) Output Cache
147정성태4/13/20068726CLR Profiler for the .NET Framework 2.0
146정성태4/13/20069701Scriptomatic Version 2.0 by the Microsoft Scripting Guys
145정성태4/13/20069151Windows Server 2003 R2 [2]
144정성태4/13/20069535WTL(Windows Template Library) 7.5
143정성태4/13/20069777.NET 1.1 에서 WebService Client 의 KeepAlive = false; 설정
142정성태4/13/20068952Virtual Server 2005 R2 (x86, x64) EE 180-day Evaluation [2]
141정성태4/13/20069638.NET 표준개발 가이드와 Microsoft.Framework 공개
140정성태4/13/20068153PAINT.NET
139정성태11/30/2005922112월 세미나 행사
137정성태11/17/20058670WSE 3.0 정식 버전
162정성태4/13/20069337    답변글 [추가]: Web Service Security Guide
136정성태11/17/20058971Creating an Outlook My.Blogs Managed Code Add-in
138정성태11/24/20058423    답변글 Ceating an Outlook Business Contact Assistant Add-in with Visual Studio Tools for Office
135정성태11/16/20058714What's port 445 used for in Windows 2000/XP?파일 다운로드1
134정성태11/15/20058703Microsoft SQL Server Management Studio Express - Community Technical Preview (CTP) November 2005 [1]
... 31  32  33  34  35  36  37  38  39  40  [41]  42  43  44  45  ...