Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What is a semaphore?

I wouldn't say you're an idiot if you don't know the answer, but we need people who can work with concurrency and a surprising number of developers haven't.



Funnily enough, coming from a telecommunications background, a semaphore will always make me think about Claude Chappe and his optical telegraph [1].

[1] https://en.wikipedia.org/wiki/Optical_telegraph


You don't usually use semaphores directly in modern programming languages. Go does everything with channels and Rust covers a lot of cases with static analysis, and has built-in high level concurrent primitives for the rest.


Perhaps so, but the synchronization primitives leak out eventually, e.g. while profiling or debugging. Semaphores also exist in other contexts, like POSIX/IPC, distributed semaphores etc.

Even if you did manage to avoid them entirely, it would suggest a lack of curiosity if you've never looked into how concurrency is implemented beneath the surface.


Even if it's not available (I haven't programmed in Go), I think most of programmers who run parallel code in Go know what is a semaphore or a mutex, don't you think?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: