有关Dbus的整理

来源:互联网 发布:淘宝什么样主图违规 编辑:程序博客网 时间:2024/04/29 20:18

What is D-Bus?

D-Bus is a message bus system, a simple way for applications totalk to one another. In addition to interprocess communication, D-Bus helpscoordinate process lifecycle; it makes it simple and reliable to code a"single instance" application or daemon, and to launch applicationsand daemons on demand when their services are needed.

D-Bus supplies both a system daemon (for events such as "newhardware device added" or "printer queue changed") and aper-user-login-session daemon (for general IPC needs among user applications).Also, the message bus is built on top of a general one-to-one message passingframework, which can be used by any two apps to communicate directly (withoutgoing through the message bus daemon). Currently the communicating applicationsare on one computer, or through unencrypted TCP/IP suitable for use behind afirewall with shared NFS home directories. (Help wanted with better remote transports - the transport mechanism iswell-abstracted and extensible.)

The D-Bus low-level API reference implementation and protocol havebeen heavily tested in the real world over several years, and are now "setin stone." Future changes will either be compatible or versionedappropriately.

The low-level libdbus reference implementation has no requireddependencies; the bus daemon's only required dependency is an XML parser (expat).Higher-level bindings specific to particular frameworks (Qt, GLib, Java, C#,Python, etc.) add more dependencies, but can make more assumptions and are thusmuch simpler to use. The bindings evolve separately from the low-level libdbus,so some are more mature and ABI-stable than others; check the docs for thebinding you plan to use.

There are also some reimplementations of the D-Bus protocol forlanguages such as C#, Java, and Ruby. These do not use the libdbus referenceimplementation.

It should be noted that the low-level implementation is notprimarily designed for application authors to use. Rather, it is a basis forbinding authors and a reference for reimplementations. If you are able to do soit is recommended that you use one of the higher level bindings orimplementations. A list of these can be found on the bindings page.

The list of projects using D-Bus is growing and they provide a wealthof examples of using the various APIs to learn from.

D-Bus is very portable to any Linux or UNIX flavor, and a port toWindows is in progress.

If you have any trouble with D-Bus or suggestions for improvement,bug reports and comments are very welcome.

Get on D-Bus today!

 

如上述引文所述,dbus是一种消息总线系统,用于简化应用程序之间的通信。除此之外,dbus还能调整进程的生命周期。

在CentOS6.5中,使用ps查看当前d-bus运行情况:

如下图所示:

 

0 0