On Sun, Nov 7, 2010 at 4:28 PM, joel falcou
On 07/11/10 05:58, Dean Michael Berris wrote:
I'm not sure how you think active objects help for massive parallelism because the active object pattern implies that you're serializing operations on a single object.
1/ Put data workload in a concurrent queue 2/ Spawn objects eating the queue asynchrnously 3/ ??? 4/ PROFIT
I don't see the limitations here.
But what you're describing is not the active object pattern. ;) An Active Object is an object that: 1. Has a synchronous interface -- meaning an API that allows you to deal with it like a normal (C++) object. If any function returns a value, it would have to return a handle to that future value (the active object pattern is intimately tied to the Future and Promise patterns). 2. It serializes operations applied to the object in a single or multiple threads of execution. An active object is said to have its own lifetime thread, which it manages itself (presumably through RAII). 3. It has normal reference semantics, but does not imply value semantics. This means an active object may be referred to through proxies or through shared references/pointers to an instance of the active object. There are some active objects that enforce the non-copyable invariant, which makes the only useful handle be either a shared pointer or a proxy of a different sort. There's much about the Active Object pattern that is important in allowing for consistent interfaces to allow traditionally non-concurrent code to deal with objects that know how to deal with concurrency. HTH -- Dean Michael Berris deanberris.com