
Just catch the exception and exit the thread gracefully. On 11/8/06, Chris Richards <chris.richards@yellowfeather.co.uk> wrote:
I have implemented a simple tcp server using asio. I wish to be able to dynamically add and remove threads from the io_service thread pool, so that when the server is heavily loaded it can be given more threads to cope with the load, but when the load reduces it can release the threads back to the OS.
I've tried posting to the io_service a handler which just throws an exception so that the thread exits, but it also resets the tcp connection and causes the acceptor thread to exit as well.
Is there a way of cleanly stopping just a single io_service::run method which would then cause the thread to exit? _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Felipe Magno de Almeida