Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4185144
  • 博文数量: 601
  • 博客积分: 15410
  • 博客等级: 上将
  • 技术积分: 6884
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-16 08:11
个人简介

独学而无友,则孤陋而寡闻!

文章分类

全部博文(601)

文章存档

2020年(1)

2018年(4)

2017年(7)

2016年(42)

2015年(25)

2014年(15)

2013年(36)

2012年(46)

2011年(117)

2010年(148)

2009年(82)

2008年(37)

2007年(41)

分类: PHP

2013-04-07 13:58:35

一、Semaphore模块:
     包括三个部分:Semaphore(互斥锁),shm(共享内存),inter-process messaging (IPC)


二、SHM
  1. Limits of Shared Memory by the Unix OS
  2. SHMMAX max size of shared memory, normally 131072 bytes
  3. SHMMIN minimum size of shared memory, normally 1 byte
  4. SHMMNI max amount of shared memory segments on a system, normally 100
  5. SHMSEG max amount of shared memory segments per process, normally 6
SHMMAX: 共享内存的最大值,一般是131072字节(128K)
SHMMIN: 最小内存,一般是1字节
SHMMNI: 共享内存的最大段数,一般是100
SHMSEG: 每个进程最大段数,一般是6

三、配置
sysvshm.init_mem       A default size of the shared memory segment.

四、函数列表:

  1. ftok — Convert a pathname and a project identifier to a System V IPC key
  2. msg_get_queue — Create or attach to a message queue
  3. msg_queue_exists — Check whether a message queue exists
  4. msg_receive — Receive a message from a message queue
  5. msg_remove_queue — Destroy a message queue
  6. msg_send — Send a message to a message queue
  7. msg_set_queue — Set information in the message queue data structure
  8. msg_stat_queue — Returns information from the message queue data structure
  9. sem_acquire — Acquire a semaphore
  10. sem_get — Get a semaphore id
  11. sem_release — Release a semaphore
  12. sem_remove — Remove a semaphore
  13. shm_attach — Creates or open a shared memory segment
  14. shm_detach — Disconnects from shared memory segment
  15. shm_get_var — Returns a variable from shared memory
  16. shm_has_var — Check whether a specific entry exists
  17. shm_put_var — Inserts or updates a variable in shared memory
  18. shm_remove_var — Removes a variable from shared memory
  19. shm_remove — Removes shared memory from Unix systems



阅读(3536) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~