• 共享内存shm_open vs shmget之跨用户共享


        shm_open() allows multiple un-related processes to access the same shared memory - since it can be accessed by a well know name.
    shmget() requires some way for the creating process to give the 'key' used to create the memory to other processes so they can access it. sometimes the creating process writes the 'key' to a well known file name so that other un-related processes can read the key.
    if the creating process only needs to share the memory with child processes created via fork(), then shmget() is ok; otherwise, shm_open() is often used.

        在跨用户访问共享内存时,shm_open会好一些,因为它的文件是放在/dev/shm的这么一个公共目录。 shmget还要特意找一个区域让多用户共享,然后再生成个不会被删除的文件来生成共享key,这样不如shm_open来的直接和明确。

  • 相关阅读:
    kubernetes之secret
    kubernetes的核心组件功能
    ingress
    服务发现: coredns
    service
    deployment控制pod进行滚动更新以及回滚
    init container
    service与pod关联
    Joiner
    SpringMVC 用注解Annotation驱动的IoC功能@Autowired @Component
  • 原文地址:https://www.cnblogs.com/dongzhiquan/p/15573242.html
Copyright © 2020-2023  润新知