其他分享
首页 > 其他分享> > System V 信号量

System V 信号量

作者:互联网

System V 信号量

1.1 基本的API介绍

semget
semctl

1.2 关联数据结构介绍

struct semid_ds {
     struct ipc_perm sem_perm;  /* Ownership and permissions */
     time_t          sem_otime; /* Last semop time */
     time_t          sem_ctime; /* Last change time */
     unsigned short  sem_nsems; /* No. of semaphores in set 信号集中实际的信号量数量*/
};

1.3 初始化信号集

1.4 信号量操作

semop
struct sembuf
{
     unsigned short sem_num;  /* semaphore number(信号集中单个信号量的序号) */
     short          sem_op;   /* semaphore operation */
     short          sem_flg;  /* operation flags */
}
semtimedop
int semtimedop(int semid, struct sembuf *sops, unsigned nsops,
               struct timespec *timeout);

1.5 信号量撤销值

1.6 System V信号量的限制

标签:semid,int,System,信号量,semop,sem,include
来源: https://blog.csdn.net/qq_27306971/article/details/100709514