by jaywalker on 12/24/10, 7:04 PM with 5 comments
by baddox on 12/24/10, 7:52 PM
by wipt on 12/24/10, 9:53 PM
by tzs on 12/25/10, 9:08 AM
Is it too much to ask to create separate sem_wait()
and sem_post() methods.
What happens when you want to do a sequence of waits and posts, and you want to do it atomically? You'd have to introduce an extra semaphore to control access to all doing your sequence.With the semop() function, you put all your desired operations in one array of ops, and make one semop call, which does all the operations atomically.