Boost logo

Boost Users :

Subject: Re: [Boost-users] Inverval timer.
From: Igor R (boost.lists_at_[hidden])
Date: 2009-02-12 15:12:52


>
> 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.



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