* 동기화는 둘 이상의 쓰레드가 서로 작업을 덮어쓰지 않고 공유 리소스(자원)에 안전하게 액세스할 수 있는 방법. * 임계영역(Critical section)공유 리소스(자원)에 Thread safety하게 접근하는 영역 * Lock 키워드보편적으로 동기화에 사용할 객체를 정의한다.object lockObj = new object();lock(lockObj) 상호 배제 잠금을 획득 using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Runtime.Remoting.Channels;using System...
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Runtime.Remoting.Channels;using System.Text;using System.Threading;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApp1{ public partial class Form1 : Form { Thread thread1 = null; Thread thread2 = null; ..