News for hackers. Stuff that matters.
Re:Beej's Guide to Unix Interprocess Communication by makecheck on Saturday December 05, 2009 @05:33PM (#978755)
This is pretty good. But it's important to understand just how much has changed over time, and to add appropriate grains of salt.

For instance, the signals reference is showing its age. On Mac OS X (and probably other systems), the current signal mechanism does not uninstall the handling function after a signal fires. Also, you could have an entire discussion on the proper use of signals within multithreaded applications, and there is no mention of threads in this tutorial (because it's dated 1997).

Re:Beej's Guide to Unix Interprocess Communication by jws on Sunday December 06, 2009 @12:22AM (#979210)
Also worth noting, in Mac OS X and other BSDs pipes are bidirectional. I assumed that was some Snow Leopard craziness, but it comes from System V.4 in 1988.

There must be a theological divide on the matter judging from the wording of the GNU man page which proudly proclaims pipes unidirectional.

Re:Beej's Guide to Unix Interprocess Communication by prodigal_erik on Sunday December 06, 2009 @02:34AM (#979300)
shutdown(2) lets you report EOF while still reading from a socket, so you can cleanly receive your peer's messages and EOF. Pipes only support close(2), so you can't report EOF without forcing your peer to handle SIGPIPE/EPIPE as well as ignoring anything else they want to send. And if your peer is writing and doesn't expect reads to work also (POSIX doesn't call for it), your own writes are just going to block and never be read.
Re:Beej's Guide to Unix Interprocess Communication by thwarted on Saturday December 05, 2009 @09:32PM (#979031)
On Mac OS X (and probably other systems), the current signal mechanism does not uninstall the handling function after a signal fires.

Be aware that this is often a difference in signal(2) vs sigaction(2), and even those often have slightly different implementations. Note the SA_RESETHAND flag to sigaction, and the section "Portability" in signal(2) in Linux's man pages.

Re:Beej's Guide to Unix Interprocess Communication by caf on Saturday December 05, 2009 @06:58PM (#978865)
Some would say that if signals are the answer, the question must be wrong.
Re:Beej's Guide to Unix Interprocess Communication by derefr on Sunday December 06, 2009 @04:45AM (#979376)
"How do you uniformly and asynchronously request that a process clean up its resources and exit, when e.g. the hardware is about to shut off?" That doesn't sound like a bad question to me.
Re:Beej's Guide to Unix Interprocess Communication by allenbrunson on Sunday December 06, 2009 @12:02AM (#979188)
the only time i've made good use of signals is for exiting. you can catch ctrl-c that way, so your app isn't forced to exit without being able to clean up. and you can install a SIGQUIT handler to take action when the os wants you to shut down.
Re:Beej's Guide to Unix Interprocess Communication by bryansum on Sunday December 06, 2009 @01:12AM (#979250)
A much more recent version of this is available @ http://beej.us/guide/bgipc/output/html/multipage/index.html
Re:Beej's Guide to Unix Interprocess Communication by andrewcooke on Saturday December 05, 2009 @04:18PM (#978645)
i used this last week! i was working out how best to coordinate access to a gpu (opencl) and decided on ipc - the shared memory messaging reduces overhead on the host, and we can have a bunch of processes running on different cores on the cpu all feeding to the gpu when appropriate. this was the best background on ipc i found.

(incidentally - does the above make sense? i am new to both gpus and ipc...)

Re:Beej's Guide to Unix Interprocess Communication by chasingsparks on Saturday December 05, 2009 @04:11PM (#978632)
I'm up-voting in homage to nostalgia. I still remember being giddy the first time I read Beej's network programming. Oh, innocence.
Re:Beej's Guide to Unix Interprocess Communication by bretpiatt on Sunday December 06, 2009 @12:15AM (#979204)
I'll agree with the nostalgia, bringing me back to college. I was at Chico with him. I however don't miss HPUX, I do miss my Slackware though.
Re:Beej's Guide to Unix Interprocess Communication by yan on Saturday December 05, 2009 @06:20PM (#978826)
Wow seeing "Beej's" made me feel nostalgic.
Re:Beej's Guide to Unix Interprocess Communication by acg on Saturday December 05, 2009 @07:35PM (#978904)
Out of date lecture notes with what looks like a bias for HP-UX. There are better sources of information.
Re:Beej's Guide to Unix Interprocess Communication by daleharvey on Saturday December 05, 2009 @10:04PM (#979064)
can you provide the links to the better sources? otherwise this isnt a very useful comment.
Re:Beej's Guide to Unix Interprocess Communication by acg on Sunday December 06, 2009 @09:30AM (#979557)
Sorry, I was trying to be concise. I'll aim to be useful. I think the guide as it is, is not only old but incomplete and mostly points to man pages. It's saving grace is the examples, which could easily be taken from a code search.

The Stevens Unix network programming is a better source if you have it. Vendor documentation is often better too. Say you were interested in SYSV IPC:

http://www.ibiblio.org/pub/Linux/docs/LDP/programmers-guide/... http://www.advancedlinuxprogramming.com/alp-folder/alp-ch05-... http://developers.sun.com/solaris/articles/named_pipes.html http://www.ibm.com/developerworks/aix/library/au-ipc/

Working code like the APR is worth reading for portability issues, particularly with sockets. I'm sure there are many other examples.

Given all this would you really use this guide when writing code?

Re:Beej's Guide to Unix Interprocess Communication by JulianMorrison on Saturday December 05, 2009 @05:21PM (#978735)
SysV IPC has message queues? I didn't know that, that looks useful.
Re:Beej's Guide to Unix Interprocess Communication by mauriez on Sunday December 06, 2009 @04:01PM (#980160)
I remember printing that. Thanks for the blast from the past! :)
Re:Beej's Guide to Unix Interprocess Communication by d0m on Sunday December 06, 2009 @12:13AM (#979201)
That's where I have learned what a socket was many years ago :)
Re:Beej's Guide to Unix Interprocess Communication by chanux on Saturday December 05, 2009 @11:28PM (#979152)
Wish if Beej's guides were continued. They are 'cool'.
Re:Beej's Guide to Unix Interprocess Communication by gometro33 on Sunday December 06, 2009 @12:30AM (#979217)
I remember my first UDP packet...