Moniter, lock중 lock사용 추천 Moniter(잘사용안함) static int number = 0; static object _obj = new object(); static void Thread_1() { for (int i = 0; i < 100000; i++) { try { Monitor.Enter(_obj); number++; } finally // 데드락 예방 { Monitor.Exit(_obj); } } } static void Thread_2() { for (int i = 0; i < 100000; i++) { try { Monitor.Enter(_obj); number--; } finally // 데드락 예방 { Monitor.Exit(_obj); } } } static voi..