Glossary
Voucher (Mach voucher)
An immutable kernel object carried in Mach messages that propagates QoS, resource accounting, importance, and persona across IPC boundaries.
A Mach voucher is an immutable, kernel-owned object that can be carried in a Mach message alongside the payload. The voucher bundles pieces of caller context the receiver may need:
- The QoS the sender wants the work done at — drives the QoS-override system across IPC chains.
- A resource accounting bucket — used for I/O and energy accounting.
- An importance boost — used for foreground-app responsiveness.
- A bank for app-extension I/O charges — used heavily by XPC.
- A persona identifier — used in iOS for App Clips and managed identities.
apple-oss-distributions/xnuosfmk/ipc/ipc_voucher.cVoucher lifecycle — alloc, dealloc, attribute manipulation.View on GitHub(line —) apple-oss-distributions/xnuosfmk/atm/atm.cActivity Trace Manager — the resource-accounting backend a voucher carries a handle to.View on GitHub(line —)
The pattern: when a receiver calls mach_msg(MSG_RCV) and a voucher is attached, the runtime adopts the voucher onto the receiving thread. The thread's QoS becomes the voucher's QoS, its energy/IO is charged to the voucher's bank, until it releases the voucher.
This is how a UTILITY-QoS daemon can correctly bill its CPU and I/O to the foreground app that requested the work, and run at the right QoS while doing so.
See also: Mach message, QoS class, the scheduler article, the Mach IPC internals article.