On 2013-02-11 22:37, monarch_dodra wrote:
Basically, I can't help but feel the thing has an hopelessly thread-global
"mailbox" approach to the problem. This is all fine and dandy if there is only a
single "canal" of communication between the master and the child/children.

What thread-global? Every mbox is in thread-local storage.

But what happens if you have 2 objects at once that want to communicate with
their children? They have to share the global mailbox, making things very 
complex.

Caller locks the callee mailbox for a moment to put a message. Doesn't lock any other thread, so you can have N/2 threads writing to other N/2 at the same time.

In my program, I have simple objects: "Manager"s, that spawn a child thread to
do work. This works fine if I have a single Manager, but how do I manage having
2 Managers at once?

It's generally a very bad idea to have more than 1 manager over one's head. :)

What should a manager do if it calls "receive", and notices the message wasn't
meant for him?

Don't know. Kill the messenger perhaps? :)


Reply via email to