System V Semaphores: How not to design an API
thejaywalker.net
System V Semaphores: How not to design an API
1–6 of 6 posts
Re: System V Semaphores: How not to design an API
#2Re: System V Semaphores: How not to design an API
#3Re: System V Semaphores: How not to design an API
#4 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.
Re: System V Semaphores: How not to design an API
#5My OS course was my first real exposure to the depths of UNIX and C. Being used to Python, I quickly got fed up with how archaic and arcane most of the UNIX/C APIs are. I have a feeling that, if it were judged by even somewhat modern software engineering standards, it would be panned.
In contrast, I don't like some of Python's abstractions, the "subprocess" being (IMO) a particularly weird way to abstract a pipe.
Re: System V Semaphores: How not to design an API
#6Is 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.