용프로그램의 모든 스레드는 프로세스에서 같은 주소 공간에 접근할 수 있다. 그러므로 [그림
4
-
2
]에서 보이는 것같이 하나의 스레드가 공유 메모리 안의 변수에 값을 쓰면 다른 모든 스레드
에서 읽을 수 있다.
그림
4-2
공유 메모리를 통한 스레드 통신
.
.
.
.
.
.
공유 메모리
쓰기
읽기
쓰기
읽기
스레드가 지역변수에 데이터를 저장하면 다른 스레드는 지역변수에 접근할 수 없다. 공유 메모
리에 데
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.