News for hackers. Stuff that matters.
Re:Fuchsia IDL Overview by kllrnohj on Thursday March 17, 2022 @07:17AM (#30709835)
RPCs aren't just slower for IPC, they are also missing very useful features. Like it's not possible to send an open file descriptor across RPC, but it's very possible (and very useful) to do the same over IPC. It's how something like an "open file dialog" can work without needing the app process to have full access to all the user's files.
Re:Fuchsia IDL Overview by guiriduro on Thursday March 17, 2022 @08:55AM (#30710617)
Well, thinking around why you'd pass around a local FD among some processes via IPC, what are the typical use cases? As a source/sink in a chain of piped processes? the connections are the pipes, not the file except at the ends. Perhaps several services cooperating to differentially process parts of a file? you'd probably architect that as a FileService that would wrap the FD and trigger events or stream to individual processing services, and here there's no fundamental difference if it runs RPC or IPC (although IPC throughput can be optimised of course, but done transparently by the ORB.) Whereas an FD-passing IPC solution is locked to local processing anyway (and only vertical scalability), and if you're already paying the price to write IDL for that, isn't the RPC/IPC style solution above both more flexible (allows hz scale), not significantly more complex or locking you into yet another IDL ?
Re:Fuchsia IDL Overview by kllrnohj on Thursday March 17, 2022 @12:03PM (#30712640)
Eh? I literally gave an example - asking the user to pick a file or open a hardware resource (audio stream, for example, or USB device). The trusted system process shows the file picker & opens the file, and then just gives the requesting app that open FD.

It's a pretty straightforward & extendable way to do permission handling, rather than needing the kernel to do all of that natively. Whereas if you go the RPC route, then you're into not just a monolithic kernel but a larger-than-ever monolithic kernel as it's now doing permission management, too.

Re:Fuchsia IDL Overview by dahfizz on Thursday March 17, 2022 @09:03AM (#30710688)
> Like it's not possible to send an open file descriptor across RPC, but it's very possible (and very useful) to do the same over IPC.

Really? I know you can use SCM_RIGHTS on a socket, if that is what you mean. In my mind IPC means shared mmap'd memory, though

Re:Fuchsia IDL Overview by kllrnohj on Thursday March 17, 2022 @12:06PM (#30712677)
Android's Binder driver can send arbitrary FDs as can unix domain sockets via sendmsg. SCM_RIGHTS isn't limited to sending sockets, it can send any FD (open file, open socket, a memfd shared memory buffer, handle to a hardware resource, etc...)