News for hackers. Stuff that matters.
Re:The Future of Asynchronous IO in Python by Animats on Thursday November 27, 2014 @12:14AM (#8666083)
It's frustrating. Many people want an interprocess subroutine call, and few OSs have the right primitives for it. (QNX does, and Windows sort of does, but the Linux/Unix world does not.) There's an endless collection of kludges so program A can call program B implemented on top of pipe/socket like mechanisms.

OpenRPC and CORBA are out of fashion. Google protocol buffers help, but don't come with a standard RPC mechanism. HTTP with JSON is easy to do but has high overhead. Then there's the handling of failure, the curse of callback-oriented systems. ("He said he'd call back. Why didn't he call back? Doesn't he like me any more? Should I dump him?")

The lack of a good, standardized interprocess call mechanism results in interprocess call logic appearing at the application level. At that level, it's intertwined with business logic and often botched.

Re:The Future of Asynchronous IO in Python by marktangotango on Thursday November 27, 2014 @09:07AM (#8667308)
This x1000. Has anyone used posix queues on linux for this? I work on a rube goldberg app that uses a custom protocol to talk to a c++ app that has a plugin system (bi directional comm between host and plugin dll), that talks to external processes over ipc. The ipc part is the cherry on top.
Re:The Future of Asynchronous IO in Python by huxley on Friday November 28, 2014 @09:41AM (#8671031)
OS X still has a great basis for interprocess communication via NeXTSTEP's PDO: http://en.wikipedia.org/wiki/Portable_Distributed_Objects it's existed for over 20 years now and is IMO unjustly ignored in spite of its simple implementation and low-overhead.
Re:The Future of Asynchronous IO in Python by lmm on Thursday November 27, 2014 @06:21AM (#8666797)
> Google protocol buffers help, but don't come with a standard RPC mechanism.

Sounds like you want Thrift.

Re:The Future of Asynchronous IO in Python by jbergens on Thursday November 27, 2014 @06:57AM (#8666855)
Doesn't Cap-n-proto have some RPC mechanism in it? Might help for some cases.
Re:The Future of Asynchronous IO in Python by lmm on Thursday November 27, 2014 @07:02AM (#8666869)
Maybe. RPC is a first-class citizen in thrift, and it's more mature and established than Cap'n Proto (and had better cross-language support last time I checked). But whatever works for your use case.
Re:The Future of Asynchronous IO in Python by leonardinius on Thursday November 27, 2014 @02:44AM (#8666363)
> Many people want an interprocess subroutine call, and few OSs have the right primitives for it. (QNX does, and Windows sort of does, but the Linux/Unix world does not.)

Could you please elaborate on Windows part of your statement? What particularly are you referring to?

Re:The Future of Asynchronous IO in Python by kevingadd on Thursday November 27, 2014 @07:55AM (#8666999)
COM/DCOM have offered a relatively usable solution for interprocess and cross-machine RPC for... quite a while. I used it to do interprocess communication back in the VB6 era (it was built-in), and in fact I did it by accident. I picked the wrong checkbox in the project options, so I ended up with the user interface of my application and the backend literally running in separate processes.

Other than the performance overhead (that I initially chalked up to 'oh, COM is just slow I guess'), the way I finally noticed was when a pointer I passed across the COM boundary wasn't valid (because it was to memory in another process). Whoops! Everything was working perfectly up until that point.

(FWIW, I am pretty sure the invalid pointer thing only happened because I was passing a raw address around - VB6 doesn't have pointer types.)

Plus, since COM provides ways to do source-level and binary compatibility, you can leverage that for your RPC.

I won't call it awesome, but it's quite robust and gets used in many places on Windows.

At a more basic level, you can trivially implement RPC using windows messages, though the security model improvements in 7 and 8 have made this a bit more complicated. There is excellent, straightforward infrastructure for establishing message loops and sending messages - really easy to get right - and it doesn't require your application to have UI. Pretty much any thread can receive and process messages if it wants to.

Re:The Future of Asynchronous IO in Python by sergiosgc on Thursday November 27, 2014 @09:09AM (#8667315)
> I picked the wrong checkbox in the project options, so I ended up with (...)

You accidentally summarized my experience with development on Windows in the nineties :-)

It's funny that what was designed as a feature of the ecosystem (tooling that abstracts complexity), completely turned me away from Windows development and into Linux development. Development on linux was, at the time, much cruder and closer to the metal. The positive note was that everyone was on the same boat, so documentation of low level routines, as well as community support, were flawless.

(not that I can, to this day, understand documentation created by kernel hackers, such as the documentation of nftables, tc or the ifb module, but I digress)

Re:The Future of Asynchronous IO in Python by cbsmith on Thursday November 27, 2014 @12:38AM (#8666126)
So often an RPC mechanism is not what you really want in the end. You tend to be better off with a MOM-style interface.
Re:The Future of Asynchronous IO in Python by wslh on Thursday November 27, 2014 @07:10AM (#8666888)
What do you mean with Windows sort of does ? Windows has good IPC.
Re:The Future of Asynchronous IO in Python by xorcist on Thursday November 27, 2014 @07:51AM (#8666989)
It depends on what you mean by IPC I guess. There's a billion and one ways to do it, everything from message passing to shared memory. If you want to do Windows-style IPC on UNIX, wouldn't SYSV IPC suffice? (QNX is of course another beast altogether.)
Re:The Future of Asynchronous IO in Python by tailhook on Thursday November 27, 2014 @05:40AM (#8666728)
Do you have a link for description of how it works in QNX?
Re:The Future of Asynchronous IO in Python by Matthias247 on Thursday November 27, 2014 @07:56AM (#8667003)
I guess it's about the QNX message passing APIs http://www.qnx.com/developers/docs/6.4.1/neutrino/sys_arch/i...
Re:The Future of Asynchronous IO in Python by flying-sheep on Thursday November 27, 2014 @01:08PM (#8668289)
is this 2004? D-Bus has been around for 9 years.

it’s not an OS primitive (yet: kdbus), but why does it need to?