首页 > 其他 > 详细

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

时间:2019-05-25 10:10:03      阅读:127      评论:0      收藏:0      [点我收藏+]

技术分享图片

 

 

 

 

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

原文:https://www.cnblogs.com/ecoflex/p/10920533.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!