DBUS IDL, XML and FIFO?

Thiago Macieira thiago at kde.org
Mon Jun 9 13:39:00 PDT 2008


Andreas Volz wrote:
>Hello,
>
>In the past I implemented an binary IPC protocol to communicate between
>two processes. A simple point-to-point solution. I think it's very
>fast. But it's in prototype state and it'll took many of my time to
>finish it. So I think about switching to DBUS. Maybe you are able to
>answer some of my questions below and help me to decide which way to go.
>
>My prototype runs in Linux. I used FIFOs as communication channel. Not
>sure about the speed compared to UNIX domain sockets. But I could
>access it from Java without JNI.
>
>So my first question is what you think about FIFO communication in
>DBUS? Are there any reasons against it? Ideas about speed?

FIFOs and Unix sockets should have about the same speed. There's no reason 
for one to be slower than the other. The connection setup time might be 
greater for sockets, though.

In any case, I've never seen FIFO used for a multi-client connection. 
Point-to-point makes sense, though.

>I use C++ and Java in my applications. I've seen that there's a Java
>implementation of DBUS. But what's about C++?

There are several using pure C++, plus mine using Qt.

>I like the idea to simply call a remote function instead of building
>messages the DBUS way. So I thought about to generate interfaces but
>with DBUS functions as low level communication instead of my own RPC.
>Has someone done something similar?

Yes: dbus-binding-tool for dbus-glib and qdbusxml2cpp for QtDBus. I don't 
know about the other bindings.

>I tried the dbus-binding-tool with a simple XML example. Works good,
>but the C code doesn't fit into my C++ design. Is there a
>dbus-binding-tool that generates C++ classes?

See above.

>Is the DBUS reference implementation thread save? So what happens if I
>put two messages from two threads the same time into DBUS?

Yes, it's thread-safe.

There's no such thing as "the same time". One of them has to happen before 
the other, since the daemon isn't threaded. Everything happens in a given 
order in the daemon.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080609/433ca72a/attachment.pgp 


More information about the dbus mailing list