Hacker News new | ask | show | jobs
by altfredd 633 days ago
> WTF? Sure you can do on top of even pipes. Even XDR could...

Of course, you "can". Implement message-based communication on top of streaming. Emulate blocking calls on top of non-blocking socket API. Implement authentication via ancillary data (try not to throw up in process). Use some clever tricks to solve priority inversion. Somehow distinguish your fds from all others file descriptors to ensure that no confused deputy problems arise.

Congratulations! You have reached feature parity with Binder.

> Binder was not even designed for Linux.

Neither are Berkeley sockets.

2 comments

(You cannot actually fully solve priority inversion _and priority propagation_ on a fully async system. There are ultimately no tricks clever enough.)
> Of course, you "can".

What is your point here? You claimed that "other IPC solutions" _could not_ do this on top of sockets, but as I've shown and now you admit, you definitely _can_. Obviously I'm not suggesting you roll this by hand, nor claiming that a plain UNIX pipe is a fully featured RPC system; just that there's a million RPC systems out there that do it and don't need anything else than sockets.

I don't know what binder does exactly, but rendez-vous synchronization is surprisingly hard to do efficiently on POSIX systems without excessive context switches.