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.

Beej's Guide to Unix IPC (2015)

220 pointsby qnttyover 3 years ago

10 comments

synergy20over 3 years ago
The IPC is in SystemV flavor but I think these days we normally should adopt Posix IPC instead especially for Linux&#x2F;BSD, am I missing something?<p><pre><code> &quot;On Linux and FreeBSD there is big advantage of posix queues, as handler given by mq_open are basically file descriptor which can be polled&#x2F;epolled&#x2F;selected&#x2F;kqueued&quot; &quot;all POSIX IPC is thread-safe, while most SysV IPC is NOT&quot;</code></pre>
评论 #29831174 未加载
dangover 3 years ago
Past related threads:<p><i>Beej&#x27;s Guide to Unix IPC (2010)</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9619375" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=9619375</a> - May 2015 (31 comments)<p><i>Beejs Guide to Unix IPC</i> - <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1525227" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=1525227</a> - July 2010 (19 comments)
Const-meover 3 years ago
fork() is rarely ideal, unless followed by exec() to launch another processes. That copy-on-write thing often wastes too much physical memory. I think threads are usually better, the shared memory allows to marshal large volumes of data without making copies.<p>I like poll() much better than signals. Signals are too limiting, and too arcane. It&#x27;s much easier to use poll() and dispatch things manually based on the signaled handles, at least there&#x27;s a guarantee your code won&#x27;t be interrupted by another event.<p>Pretty much all modern kernel things are compatible with poll. There&#x27;s eventfd() which acts as an event or semaphore, message queues (but not the ones from the article, better ones, created with mq_open not msgget), Unix domain sockets for cross-process messaging. There&#x27;s more, poll() can track termination of processes (see pidfd_open), page flip events in a GPU with DRM, consumed or available video&#x2F;audio samples with V4L2 or ALSA.
评论 #29832116 未加载
评论 #29832816 未加载
badrabbitover 3 years ago
Any reason to use these in new code instead of say.. dbus?
评论 #29833071 未加载
评论 #29832981 未加载
bool3maxover 3 years ago
I personally dislike Beej&#x27;s writing style. I tried to like his Network Programming guide but I found that most of what it conveys can be learned more quickly by simply reading the relevant POSIX&#x2F;Linux manpages.
评论 #29942018 未加载
alexander1100over 3 years ago
Been really is one of the greatest unofficial mentors of the greater development community
评论 #29834014 未加载
biohax2015over 3 years ago
Is this still up-to-date?
评论 #29833331 未加载
DataDaoDeover 3 years ago
Beej&#x27;s guides are amazing with a memorable and entertaining writing style. I remember reading his network guide almost two decades ago when I was a kid, had just heard of this thing called a socket, but the only connotation I had for one at the time was a wall socket. His guide helped me understand networking but more importantly it made it a fun experience for a programmer just starting out.
评论 #29831159 未加载
评论 #29832194 未加载
评论 #29832041 未加载
评论 #29832177 未加载
评论 #29833855 未加载
colbyhubover 3 years ago
I freaking love his guides, I&#x27;m currently reading through his C guide: <a href="https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;" rel="nofollow">https:&#x2F;&#x2F;beej.us&#x2F;guide&#x2F;bgc&#x2F;</a><p>It&#x27;s very entertaining to read though which holds my attention well, and is well suited to people with existing programming experience. I&#x27;ve tried to read K&amp;R but I keep coming back to Beej&#x27;s.
评论 #29836736 未加载
nathiasover 3 years ago
Beej really has the best guides.