Basic Linux IPC

linux-ipc-communication linux-ipc-synchronization

D-Bus

D-Bus is a message bus system for inter-process communication (IPC)

D-Bus is enabled automatically when using systemd because dbus is a dependency of systemd.

What’s D-Bus

  • a powerful IPC system

  • the closest thing to a standard in this area as can be found on Linux

  • provides a nice method-call transaction mechanism

  • has fundamental inefficiencies of the user-space implementation
    • well suited to control tasks
      • works well to tell a sound server to change the volume

    • less so for anything that has to carry significant amounts of data
      • one would not want to try to send the actual audio data over the bus

  • In D-Bus a call-return message requires 10 message copies, 4 message validations, 4 context switches

  • D-Bus has no timestamps on messages

  • not available at early boot

  • We need a better implementation -> kdbus

D-Bus - Architecture

  • libdbus

  • dbus-daemon

  • wrapper libraries based on particular application frameworks

Interesting :

In 2013 the systemd project rewrote libdbus in an effort to simplify the code, but it turned out to significantly increase the performance of D-Bus as well.
In preliminary benchmarks, BMW found that the systemd D-Bus library increased performance by 360%.
linux desktop architecture

kdbus