TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

System V Semaphores: How not to design an API

11 pointsby jaywalkerover 14 years ago

3 comments

baddoxover 14 years ago
My 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.
评论 #2038750 未加载
wiptover 14 years ago
There is probably a logical reason to the design and nomenclature of the system. Unfortunately, these things seem to get lost over time. I imagine that in another twenty to thirty years a portion of our current technology will be considered unnecessarily complicated and obfuscated.
tzsover 14 years ago
<p><pre><code> Is it too much to ask to create separate sem_wait() and sem_post() methods. </code></pre> 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.<p>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.
评论 #2038779 未加载