From: Felipe Magno de Almeida (felipe.m.almeida_at_[hidden])
Date: 2006-11-08 11:13:35
Just catch the exception and exit the thread gracefully.
On 11/8/06, Chris Richards <chris.richards_at_[hidden]> 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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk