Difference Between Sem_Init and Sema_Init
What Is the Difference Between Sema_Init and Sem_Init? Are There Any Specific Usage Scenarios and Other Dependencies for the Respective Apis? 2 Answers Since...
What is the difference between sema_init and sem_init ? Are there any specific usage scenarios and other dependencies for the respective APIs ?
2 Answers
Since you tagged this with "linux" I'll ignore other Unixes.
sema_init is the Linux kernel's counting semaphore implementation initialization function.
sem_init is the initializer from the Posix thread library (and is therefore used by userspace code).
- sema_init is from the Solaris thread library.
- sem_init is from the Posix pthread library.