Hi!

I created a (yet another) threapool library a few month ago and, at my company, we are starting to use it widely in different services. Using the library has lots of advantages for us, mainly because of it performance compared with similar libraries.

The problem we  are having is that we are using 'two' different kinds of thread pool in the same service:
 * The first one is the one I wrote above, the pool provided by my library, which is used to execute by the service to execute long or expensive operations.
 * And the second one, is the one created a the network level, where about a hundred threads are created in order to attend network requests.
 ** Actually calling  new thread(io_service::run, ...) 

I wanted to move the thread-handling at the network level to my library, so I started to look at documentation about extending boost::asio and adapting my library to the io_service requirements. What I want to do now is to make the io_service object actually use the threadpool library for task execution.

I have taken a look to use_service, add_service, and the io_service::service class, and I think I already have a pretty good implementation of a 'poor man's adaptor' between my library and boost asio.

The question is, how do I force the io_service object  to use my service implementation instead of the on provided by boost::asio::detail::task_io_service?

I mean, I haven't tested yet but I have no idea about how does the io_service know which service should be used in each case.

Do I have to force the removal of task_io_service?
Do I have to call pool() somewhere or re-implement run() functions?

Thanks in advance

Best Regards

__________
Saludos!
     Juan