[haiku-development] Re: Haiku "Hello, World" tutorial

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 14 Sep 2009 19:28:26 -0400

On Mon, Sep 14, 2009 at 6:52 PM, Rene Gollent <anevilyak@xxxxxxxxx> wrote:
>
> be_app_messenger is indeed safer but *most* of the time it won't
> matter. The main reason the messenger is safer is it can check the
> looper list to ensure that the target is in fact valid before sending
> the message, whereas the PostMessage variant more or less assumes the
> app pointer is still valid. In the majority of cases this will be true
> since the app is generally the last thing to exit, but especially if
> you're using threads of your own that you've spawned outside of the
> ones belonging to the loopers, that's not guaranteed depending on when
> you terminate such a thread. In general it's good practice to avoid
> using PostMessage directly on anything that's not attached to the same
> looper as the caller, so I'd discourage even suggesting the
> PostMessage variant above.

Yeah that makes sense but I'm pretty sure I've seen the PostMessage
version used a lot more than the SendMessage one. Maybe we need to
update some code then ;)

-- 
Regards,
Ryan

Other related posts: