[haiku-development] Re: Need help understanding BMessages.

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 03 Oct 2009 22:55:59 +0200

Hi,

On 2009-10-03 at 21:44:48 [+0200], Alexandre Moreira 
<alexandream@xxxxxxxxx> wrote:
> Hello, everyone. I've been trying to understand the way BMessages work in 
> Haiku/BeOS, but I'm having some trouble.
> 
> Can anyone please explain a little about how BMessages compares to 
> DBus-Style messages, so I can leverage previous knowledge to better 
> understand them?

A great overview is in the BeBook:

<http://www.haiku-os.org/legacy-docs/bebook/TheApplicationKit_Messaging.html>

In a nutshell: BMessage is a container that can hold typed data, arrays of 
data and also other BMessages (nesting). It also offers utility methods for 
getting info about the sender of the message and how to reply. Messaging 
works either by attaching messages to the message queue of a BLooper, if it 
is part of the same process, or by flattening it and transmitting it via a 
port (a kernel feature somewhat similar to pipes). The receiving BLooper 
lets the target BHandler process the message, a BLooper is also a BHandler 
and is the default handler. I can't really say how this compares to DBus, 
since I don't know anything about it. Since BMessage passing was 
fundamental to BeOS, the BeBook explains this really well, so you should be 
able to learn everything about it from the above link and the other 
chapters.

Best regards,
-Stephan

Other related posts: