[Operating System] {ud923} P3L3: Inter-Process Communication

Posted ecoflex

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Operating System] {ud923} P3L3: Inter-Process Communication相关的知识,希望对你有一定的参考价值。

技术图片

 

 

 

 

Visual Metaphor

技术图片

 

 

 

Inter Process Communication

技术图片

 

 

Message Based IPC

技术图片

 

 

 Forms of Message Passing

技术图片

 

 

 

 

 Shared Memory IPC

 技术图片

 

 

 

 Copy vs. Map

技术图片

In windows:

(1), data size smaller than a threshold => copy

(2) othersiwe => copy to page aligned area and map

 

 

 

 

SysV Shared Memory 

 技术图片

Segments will be removed only when it‘s explicitly deleted or the system reboots

Whereas the regular non-shared memory that is malloced will disappear as soon as the process exists.

 

 

 

 SysV Shared Memory API

 技术图片

 

 https://www.tutorialspoint.com/inter_process_communication/inter_process_communication_system_v_posix.htm

 

 POSIX Shared Memory API

技术图片

http://man7.org/linux/man-pages/man7/shm_overview.7.html

 

 

 

 

Shared Memory and Sync 

 技术图片

 

 

 

PThreads Sync for IPC 

 技术图片

Sync data be shared and visible to both processes.

技术图片

 Here, system V api.

 

shmget(fork(segmentation_id, integer parameter), segment_size, area_permission)

  segmentation_id => shared memory identifier => uniquely created from token operation => with arg[0] from command line

  integer parameter => 120 here

  segment_size => 1024 => 1KB

   return seg;

shmat(seg, ...)

  return shared_memory_address;

 

 

 

IPC Resources

 

 

 Sync for Other IPC

 技术图片

 

 

 

 

技术图片

 https://www.geeksforgeeks.org/ipc-using-message-queues/

 

 

 

IPC Command Line Tools

技术图片

 

 

 

 Shared Mem Design Considerations

 技术图片

 

 

 

 How Many Segments?

 技术图片

 

 

 Design Considerations

 技术图片

 

 

 

技术图片

 

以上是关于[Operating System] {ud923} P3L3: Inter-Process Communication的主要内容,如果未能解决你的问题,请参考以下文章

[Operating System] {ud923} P3L4: Synchronization Constructs

[Operating System] {ud923} P4L4: Datacenter Technologies

[Operating System] {ud923} P3L3: Inter-Process Communication

什么是Operating System

Introduction to operating systems----《Computer operating system》

operating system 操作系统