Boost logo

Boost :

Subject: Re: [boost] Boost Asio in Windows
From: Boris Schaeling (boris_at_[hidden])
Date: 2009-05-10 06:52:28


On Sat, 09 May 2009 17:36:30 +0200, Kenny Stone <kstone_at_[hidden]>
wrote:

> void start()
> {
> tcp::endpoint endpoint = *iterator_;
> socket_.async_connect(endpoint,
> boost::bind(&MessageHandler::handle_connect, this,
> boost::asio::placeholders::error, ++iterator_ ) );
> boost::thread t( boost::bind( &boost::asio::io_service::run,
> &(socket_.get_io_service() )));
> t.detach();
> //threadPool_.schedule(boost::bind( &boost::asio::io_service::run,
> &(socket_.get_io_service()) ) );
> }
>
> The commented out line is what I wanted to use (threadpool), as thread
> detach is far from an ideal situation. To work in windows, I have to
> call
> io_service.run() in this function and thread detach; it doesn't seem to

I can't help you with the threadpool. But as the destructor of
boost::thread calls detach() you don't need to call it yourself?

Boris

> [...]


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk