The design pattern of the active object, as I understand it, connects the (private / allocated) stream of the lifetime to the object and makes it work with independent data. From some of the documentation I read, the evolution of such a paradigm was explained by two reasons: firstly, managing raw threads would be painful, and secondly, problems associated with a shared resource do not scale well using mutexes and locks. while I agree with the first reason, I do not fully understand the second. If the object is active, it makes the object independent, but problems like the statement for lock / mutex still exist (since we still have a shared queue / buffer), the object simply delegated responsibility for sharing the message queue. The only advantage of this design pattern,as I see it, this is the case when I had to perform a long asynch task for a shared object (now, when I just pass the message to the shared queue, the threads no longer need to lock mutex / locks for a long time, but they will still block and fight for posting messages / tasks). In addition to this case, someone can tell more scenarios in which such a design template will have other advantages.
The second question I have (I just started digging around design patterns) is what is the conceptual difference between the design pattern of the active object, reactor and proactor. How do you decide which design scheme is more effective and suits your requirements more. It would be very nice if someone could demonstrate some examples showing how the three design patterns will look like, and who has comparative advantages / disadvantages in different scenarios.
I'm a bit confused, since I used an active object (which used a shared thread-safe buffer) and boost :: asio (Proactor) to make a similar look of asynchronous material, I would like to know if anyone has more understanding of the applicability different patterns when approaching a problem.