1.6.4 Limits on Semaphore Resources
Sizeof various structures:
semid_ds 44 /* 1 per semaphore array .. dynamic */
sem 8 /* 1 for each semaphore in system .. dynamic */
sembuf 6 /* allocated by user */
sem_undo 20 /* 1 for each undo request .. dynamic */
Limits :
- SEMVMX 32767 semaphore maximum value (short).
- SEMMNI number of semaphore identifiers (or arrays) system wide...policy.
- SEMMSL maximum number of semaphores per id.
1 semid_ds per array, 1 struct sem per semaphore
=> SEMMSL = (PAGE_SIZE - sizeof(semid_ds)) / sizeof(sem).
Implementation maximum SEMMSL = 500.
- SEMMNS maximum number of semaphores system wide ... policy.
Setting SEMMNS >= SEMMSL*SEMMNI makes it irrelevent.
- SEMOPM Maximum number of operations in one semop call...policy.
Unused or unimplemented:
SEMAEM adjust on exit max value.
SEMMNU number of undo structures system-wide.
SEMUME maximum number of undo entries per process.