Boost logo

Boost Users :

Subject: Re: [Boost-users] Inverval timer.
From: Alexei Sergeev (alexeisergeev_at_[hidden])
Date: 2009-02-12 15:17:38


On Thursday 12 February 2009 23:12:52 Igor R wrote:
> > If I use run there application hang, it doesn't use CPU and doesn't eat
> > memory, just stop responce.
>
> io_service::run() blocks until all the work is done. However, you can run
> io_service in another thread, like this:
> boost::thread thread(boost::bind(&io_service::run, &io_service_)); //note
> that io_service_ must outlive the thread
>
> then you can use this io_service with any number of timers/sockets - all
> their handlers will run in that thread.

Thank you, this helps and I think I will use it for sockets as well.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net