
On Wed, 14 Dec 2005 07:50:38 +1300, "simon meiklejohn" <simon@simonmeiklejohn.com> wrote: [using asio with Windows message loops]
use with asio Its feasible to use this to create dispatcher class, similar to asio::locking_dispatcher which can be used to send function objects to be executed in the gui thread (call this asio::gui_dispatcher). This component internally creates a hidden window. A call to gui_dispatcher.post() or dispatch() queues the function object and posts a message to the hidden window. The windows proc associated with the window then unqueues the function object and calls it.
I dont think you need to register every window with asio. Just create one gui_dispatcher and use it to wrap your Handlers before passing them to asio socket functions.
(theres a zip in the vault Defer.zip under Concurrent Programming that does something like this but not as an asio::dispatcher model)
It still seems to me that you would have to register the sockets with a shared demuxer. That wouldn't work for me, because in addition to using my components internally in my application (where I could do it), I also wrap them up in ActiveX controls. Other applications use several of these controls, and a shared demuxer isn't going to be possible. 2 more threads per control (plus one more if I want timers) is going to push the thread count too high. I don't know if it's feasible to use asio for something like this, but it would be very nice if I could. -- Be seeing you.