3.4 Interprocess Communication (IPC)
IPC란 무엇인가?
- 프로세스가 독립적이지 않고, 협력할 경우 다른 프로세스에 영향을 주고, 받을 수 있다. 이런 프로세스 사이의 통신을 IPC라고 한다.
- exchange data - 데이터의 교환
send data - 데이터 발신
receive data - 데이터 수신
Two fundamental models of IPC
- shared memory
- message passing
3.5 IPC in Shared-
Memory Systems
Producer-Cunsumer Problem
- 프로듀서와 컨슈머가 공유하는 메모리 영역
- buffer 사용 - shared buffer
프로듀서는 버퍼를 채운다(쓴다).
컨슈머는 버퍼를 비운다(읽는다)
3.6 IPC in Message-Passing Systems
- O/S가 shared memory를 관리하고, 어플리케이션 레벨에서는 메시지만 주고 받는 방식
- send(message) system call
- receive(message) system call
direct communication
- 수신자를 명시적으로 표현해 줌
- 하나의 링크만 가능
indirect communication
- 메시지를 mailbox(port)에 보낸다.
- 여러개의 프로세스들이 사용 가능 함
- 복잡한 커뮤니케이션도 가능
- create, send, receive, delete
Different design options for implementation
- blocking or non-blocking
- synchronous or asynchronous - 동기화 여부(서로 알고 있는지에 대한 여부)