Boost Users :
Subject: Re: [Boost-users] [wave] assertion failed - multithread issue?
From: Sohail Somani (sohail_at_[hidden])
Date: 2009-03-09 18:36:52
Ein Held wrote:
> std::ifstream instream(file_name);
> file =
> for(int i=0;i<10;++i)
> boost::thread t(test);
I assume you are using the latest Boost.
At a quick glance, it seems that it is possible for one of your 10
threads to still be running when the main program exits. I wonder if
this is the problem.
You might want to use thread_group and join_all to make sure.
// destructor calls detach() -> thread keeps running
test(); // possible to finish before one of the above threads
Try changing to:
-- Sohail Somani http://uint32t.blogspot.com
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