Zygote
How Android works

Binder & IPC

How a hundred sandboxed processes talk without trusting each other.

5 pages59 min5 interactive8100 words
  1. 01Why Binder wonAndroid had sockets, pipes and shared memory. It built a kernel driver instead — because IPC on a phone has to be fast, attributable, and bounded, and no general-purpose transport is all three.intermediate14 mininteractive
  2. 02Binder, the driverOne ioctl, a Parcel, a handle table and a reference count. The Binder driver is a small kernel component that decides how a hundred million calls a day behave when things go wrong.nerd12 mininteractive
  3. 03AIDL: the interface languageWrite the contract once, and the build generates the Parcel marshalling for both sides. AIDL is the difference between 'call transact()' and 'call getTaskCount()'.intermediate11 mininteractive
  4. 04The IPC you already useIntents, broadcasts, ContentProviders and Messenger are Binder underneath. Each one is a different level of abstraction over the same driver, chosen for a different kind of conversation.intermediate11 mininteractive
  5. 05Binder threads and performanceBinder is cheap per call, but it is not free, and the pool behind every service is finite. The interesting failures are the ones where the transport is working perfectly and the system is still stuck.nerd11 mininteractive

Test yourself

Test yourself: Binder & IPC

1 / 8

A synchronous Binder call is made to a cached app that the system has frozen. What does the platform do?

0 answered · 0 correct