02-Jan-2013 03:54, Charles Hixson пишет:
If I were to use the below as an asynchronous communication channel, would it avoid deadlocks (presuming that only Cell called Msg) and that when a thread activated Cell, the first thing it did was process it's mailbox? Also, if only around 7 cells were created in the main thread, would RAM usage remain reasonable (i.e., when a thread was through with an MCell, would only one copy continue to exist in RAM? Or would there be a copy for each thread that had ever referenced it? Should MCell instances be marked shared?
That's a lot of questions to ask and currently I hardly can decipher the whole logic from this and the code below alone, too much is behind the scenes.
I'm willing to help out if you could post a more complete example or more accurate questions as e.g. "created 7 cells in main thread" could be done very differently.
Also a nit at this size of code (and for me it's unformatted) I'd recommend linking to the code on some paste service e.g. dpaste http://dpaste.dzfl.pl/.
[snip] -- Dmitry Olshansky