I can also reproduce it on my WinXP (32bit) & MSVC 9 machine, but only when no debugger is attached :( At least waiting with attached debugger (release compiled build) for about 10 minutes did not cause this app to crash.
Last time I coded some C++ source parser with Wave (almost 2 years ago) it worked fine in MT environment with pretty much heavy load, but that were every time different files. What I found out for now is that wave::context can't deal with std::string::const_iterator. Why? I get a compiler error. If it uses non-const iterator, is it changing the string? Luckily making a local copy of the file string in each thread causes the app to crash almost immediately in the token_data::dtor. But just a question, is token_data only wave::context related or is it used accross contexts?
My modified source:
#include <fstream> #include <string>
//Wave does not like the new interface :( //#define BOOST_FILESYSTEM_NO_DEPRECATED #include <boost/thread.hpp> #include <boost/wave.hpp>
#include <boost/wave/cpplexer/cpp_lex_token.hpp> #include <boost/wave/cpplexer/cpp_lex_iterator.hpp>