Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

simple-shared-memory

IPC(Inter-Process Communication) Shared Memory

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

simple-shared-memory

물리 메모리를 할당하여 프로세스 간 데이터 공유

  • 각 프로세스는 독립적인 가상 메모리 공간을 가지고 있습니다. 그러나 운영체제는 가상 메모리 매핑을 통해 실제 물리 메모리에 값을 저장합니다.
  • CreateFileMapping 를 사용해 고유한 이름의 파일 매핑 객체를 생성합니다.
  • MapViewOfFile 를 통해 생성한 파일 매핑 객체를 자신의 가상 주소 공간에 매핑합니다.
  • 여러 프로세스가 동일한 파일 매핑 객체에 접근함으로써 A와 B 두 프로세스 모두 동일한 물리 메모리 영역을 참조하게 됩니다.