However the same change in a real code using WorkQueue internally and using similar code to the test
makes the future::get() provide invalid pointers with values close to 0x000000 but not exactly.
This code then makes access violation as the pointers are obviously not valid.
So far I know:
- having a std::vector instead of tbb::concurrent_queue makes the test work (the real code can't use std::vector, it's concurrent);
- using std::future/promise instead of boost::future/promise makes the test work ...;
- ...but not the real code (which should be almost the same than the test);
My current suspicion: maybe I do something wrong with the lifetime of the promise?
I don't see what unfortunately.
I'll try to reproduce the problem with std::future/promise I see in my real code but in the test.
Joel Lamotte