Quote:
Originally posted by Jo_Nak
Hi!
I am programming in C++. This is the situation: I have a main thread that takes care of the interactions of the user and the GUI. Then I have 4 threads running in the background. Each thread maintains a STL vector declared:
vector<TBitmap*> VectorFrame;
How can I pass this vector to the main thread (because it is not a pointer)?
I thought maybe mapping it into a location in the memory. Is it a good way and how do I do that? Is there a better way?
Thanks a lot.
Any help is greatly appreciated.
J.N.
|
You can define this vectors in static context (outside function) or somewhere else where they will be accessiblle both in main() and in your threads. In this way you must use some synchronization methods to acceess this vectors from different threads.