[interfacekit] Re: BLooper reusability

Some info on R5:

BWindow reads BMessages from two different sources, first through
_CEventPort_ and then through the message port.

_CEventPort_ gets its messages from one of the areas of the application.
It's a very small and efficient class, which only needs to acquire a
semaphore when its pending messages reach zero (ProcessPending, it checks if
there's a new batch available).

I think however that the best solution is still the R5 one, copy/paste
task_looper, and add the _CEventPort_ processing. If it's needed by third
parties to read from other sources, they can always spawn a thread, read
(even with polling or blocking), and post the messages to the BWindow. If
you lock the window, you can even put a batch directly in the messagequeue,
no?

Of course that's just my opinion :).

Marc Flerackers (mflerackers@xxxxxxxxxx)
Software Engineer


Other related posts: