On 9/30/2013 5:41 PM, Quoth Bo Jensen:[...]
I have build a job queue with a combination io_service,
io_service::work, packaged_task and a thread group. I am seeing randomly
either segfaults or strange asserts in pthread or even malloc, which
suggest to me memory is being corrupted somehow.
What are you doing once this has returned?
I can wait for a job to finish like this :
boost::wait_for_any(io_future_.begin(),io_future_.end());
In particular note that if you want to "give up" on retrieving any further results then you must stop() the io_service and join_all() the thread group (in that order) before you allow the io_service or thread_group to be destroyed. Their respective destructors do not do this for you.
(Also note that this will of course still complete however many tasks have already started to process, unless you have some other means of cancelling a task in progress, such as using interruption points.)
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users