01 개요

스레드

메모리, 파일 핸들과 같이 프로세스에 할당된 자원을 공유한다. 하지만 각 스레드는 각기 별도의 프로그램 카운터, 스택, 지역 변수를 갖는다.

스레드는 자신이 포함된 프로세스의 메모리 주소 공간을 공유하기 때문에 한 프로세스 내 모든 스레드는 같은 변수에 접근하고 같은 힙에 객체를 할당한다.

참고

멀티 프로세스 vs 멀티 스레드

https://www.baeldung.com/cs/process-vs-thread

https://inpa.tistory.com/entry/👩‍💻-multi-process-multi-thread

concurrency

https://docs.oracle.com/javase/tutorial/essential/concurrency/index.html

synchronized

https://www.baeldung.com/java-synchronized

race condition

https://www.baeldung.com/cs/race-conditions

세마포어, 뮤텍스, 모니터

https://www.baeldung.com/cs/semaphore

https://www.baeldung.com/cs/semaphore-vs-mutex

https://www.baeldung.com/cs/monitor