[haiku-development] Re: BMessenger and synchronous replies

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 30 Apr 2010 09:08:29 +0200

Chris Peel <chris.gsi@xxxxxxxxxxxx> wrote:
> My question is - how does the reply message _actually_ get back to  
> BMessenger->SendMessage()?  Is it:
> 
> (a) by copying memory between processes

Generally, messaging works using ports. A BMessenger combines the target 
port, plus its team as well as a target token that identifies a 
specific handler.
The synchronous reply mechanism just uses one of a cached list of reply 
ports that are only used for this case. See src/kits/app/Message.cpp 
line 2177ff.

While messaging uses ports (and with them, memory copies between 
processes), the actual data might be sent using an area after some 
threshold is reached (IIRC 64K).

Bye,
   Axel.


Other related posts: