https://s3-us-west-2.amazonaws.com/secure.notion-static.com/f5c6b913-68c6-42da-85e3-74aa188773af/20210419_215632.jpg

멀티 프로세스

멀티 스레드

멀티 스레드 예제 코드

public class Start6 extends Thread {
	static int share;

	public static void main(String[] args) {
		Start6 t1 = new Start6();
		Start6 t2 = new Start6();

		t1.start();
		t2.start();
	}

	public void run() {
		for(int count = 0; count < 10; count++) {
			System.out.println(share++);
	
			try { sleep(1000); }
			catch (InterruptedException e) {}
		}
	}
}