D-Bus

D-Bus
D-Bus
Developer(s) Red Hat and the community
Stable release 1.4.12[1] / June 10, 2011; 5 months ago (2011-06-10)
Operating system Cross-platform
Type Inter-process communication
License GNU General Public License or Academic Free License 2.1[2]
Website www.freedesktop.org/wiki/Software/dbus

In computing, D-Bus (Desktop Bus) is a simple inter-process communication (IPC) open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, 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.

Red Hat operates as the primary developer of D-Bus as part of the freedesktop.org project.

Contents

Design

D-Bus allows programs to register with it in order to offer services. It also allows client programs to check for the availability of services. Programs can also register as waiting for events of the kernel, as in the case of hot-swapping hardware.

D-Bus functionality runs as a daemon: typically dbus-daemon. Users can run several instances of it, each called a channel. Most systems implement a privileged system channel, plus a private channel for each logged-in user. The private channels are required because the system channel has access restrictions.

The purpose of the private channel is to provide unrestricted communication among any applications of the user.

Currently, D-Bus works over Unix sockets, but work is being done to create a 'peer-to-peer' socket in the Linux kernel able to route messages between applications, leaving the daemon as a top-level manager.[3] The main advantage of this new approach is that it improves speed by halving the number of memory-copy operations.

Architecture

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 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

Each application using D-Bus contains objects that usually map to GObject, QObject, C++ 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 users 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 refer to an object. Many programming languages refer to this as a pointer or reference. However, these references are implemented as memory addresses relative to the address space of the application, and thus can't be passed from one application to another.

To solve this, D-Bus introduces 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 /com/mycompany/c5yo817y0c1y1c5b if it makes sense for their application.

The D-Bus objects' names are namespaced to keep different code modules separated. Namespaces are generally prefixed with the developer's reversed domain name components (e.g. /org/kde).

See also

References

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Bus transport in the United Kingdom — Buses play a major role in the public transport of the United Kingdom, as well as seeing extensive private use.History The horse bus era The first omnibus service in the United Kingdom was started by John Greenwood between Pendleton and… …   Wikipedia

  • Bus routes in Sydney — Bus routes in Sydney, Australia are numbered with three digits, the first digit referring to the region in which the bus route primarily operates.Northern BeachesBus services between the Northern Beaches region of Sydney and the central business… …   Wikipedia

  • Bus Parisien — Situation Paris et petite couronne Type Autobus …   Wikipédia en Français

  • Bus RATP — Bus parisien Bus parisien Situation Paris et petite couronne Type Autobus …   Wikipédia en Français

  • Bus parisien — Situation Paris et petite couronne Type Autobus …   Wikipédia en Français

  • Bus parisiens — Bus parisien Bus parisien Situation Paris et petite couronne Type Autobus …   Wikipédia en Français

  • Bus rapid transit — ( BRT ) is a broad term given to a variety of transportation systems that, through improvements to infrastructure, vehicles and scheduling, attempt to use buses to provide a service that is of a higher quality than an ordinary bus line. Each BRT… …   Wikipedia

  • Bus manufacturing — describes the manufacturing of buses and coaches.HistoryBus manufacturing had its earliest origins in carriage building. Other bus manufacturers had their origins in truck manufacturing. Historically, bus chassis were shared between truck designs …   Wikipedia

  • Bus (informatique) — Bus informatique Pour les articles homonymes, voir Bus. bus VME Un bus informatique désigne l ensemble des lignes de communication connectant différents composan …   Wikipédia en Français

  • Bus Blancs — de la Croix Rouge suédoise, probablement à proximité du domaine de leur quartier général à Friedrichsruh Le terme Bus blancs a été utilisé pour une opération humanitaire dont le fer de lance fut le comte suédois Folke Bernadotte sous les ausp …   Wikipédia en Français

  • Bus Informatique — Pour les articles homonymes, voir Bus. bus VME Un bus informatique désigne l ensemble des lignes de communication connectant différents composan …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”