linux - D-Bus

System/Linux 2013. 8. 30. 09:36


D-Bus
Developer(s)Red Hat and the community
Stable release1.6.12[1] / June 13, 2013; 2 months ago
Operating systemCross-platform
TypeInter-process communication
LicenseGNU General Public License or Academic Free License 2.1[2]
Websitewww.freedesktop.org/wiki/Software/dbus


D-Bus is an free and open-source inter-process communication (IPC) system, allowing multiple, concurrently-running computer programs (processes) to communicate with one another. It is mainly used by components of the free desktop implementations such as GNOMEKDE SC or Xfce.

Heavily influenced by the DCOP system used by versions 2 and 3 of KDE, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating systems, and a port for Windows exists. It is used by Qt 4 and GNOME. In GNOME it has gradually replaced most parts of the earlier Bonobo mechanism.

D-Bus is developed as part of the freedesktop.org project.

Design[edit source | editbeta]

D-Bus is a message-bus system, a way for applications to talk to one another. D-Bus supplies both a system daemon (for events such as "new hardware device added" or "printer queue changed") and a per-user-login-session daemon (for general inter-process communication needs among user applications). The message bus builds on a general one-to-one message passing framework, which any two apps can use to communicate directly (without going through the message bus daemon). Most systems implement a privileged system channel, plus a private channel for each logged-in user, so that available information in the D-Bus registry can be restricted.

D-Bus works with Unix sockets between applications and daemons (applications communicate with each other through a fork of the D-Bus daemon), but work has started to create a "peer-to-peer" socket-type in the Linux kernel able to route messages between applications, leaving the daemon as a top-level manager.[3] The new approach improves speed by halving the number of memory-copy operations.

Architecture[edit source | editbeta]

Example of usage in Linux-based systems. The dbus-daemon (named ubus in the illustration) is pretty much at the core of the modern Linux graphical desktop environment. Binder is the counterpart used on Android.

D-Bus has three architectural layers:[4]

  1. libdbus - a library that allows two applications to connect to each other and exchange messages
  2. dbus-daemon - a message-bus daemon executable, built on libdbus, that multiple applications can connect to. The daemon can route messages from one application to zero or more applications, thereby implementing the publish/subscribe paradigm.
  3. wrapper libraries based on particular application frameworks

The design of D-Bus addresses two specific cases:

  1. communication between desktop applications in the same desktop session; to allow integration of the desktop session as a whole, and address issues of the process lifecycle
  2. communication between the desktop session and the operating system, where the operating system would typically include the kernel and any system daemons or processes

Mechanisms[edit source | editbeta]

Each application using D-Bus contains objects that usually map to GObjectQObjectC++ objects, or Python objects. Each D-bus object operates as an instance rather than as a type. Messages received over a D-Bus connection get routed to a specific object, not to the application as a whole. In this way, D-Bus resembles software componentry, as it appears to clients as if they are interacting with an object across the IPC connection, whether or not there is an object on the other side.

To allow messages to specify their destination object, the system needs a way to identify and address an object. For this purpose, D-Bus defines a name for each object. The name looks like a filesystem path, for example an object could have the name /org/kde/kspread/sheets/3/cells/4/5. D-Bus encourages human-readable paths, but developers are free to create an object named (e.g.)/com/mycompany/c5yo817y0c1y1c5b if it makes sense for their application.

The D-Bus objects' names are namespaced to help with independently developing code modules[citation needed]. Namespaces are generally prefixed with the developer's reversed domain name components (e.g. /org/kde).

See also[edit source | editbeta]

References[edit source | editbeta]

External links[edit source | editbeta]



출처 - http://en.wikipedia.org/wiki/D-Bus








'System > Linux' 카테고리의 다른 글

linux - chmod 700 변경하기  (0) 2013.10.31
linux - 이미지(사진) 편집 툴 모음  (0) 2013.10.26
linux - fedora repair filesystem  (0) 2013.08.30
linux - cron, crontab  (0) 2013.08.23
linux - watch and grep  (0) 2013.07.12
Posted by linuxism
,