I am currently developing new features for an existing VCL application. The application creates charts and static images using a thirdparty package called TeeChart. There is one instance where I have to load in 2 million data points to create a static image chart. However, this takes a while to load and the user can't do anything in the application until it is completed. Therefore I would prefer to create a worker thread to process the data points so the GUI doesn't freeze.
The method setData()
sets the following member variables, which the VCL component will then go on and use to create the Chart:
// Holds the Y position for the image (columns)
DynamicArray<double>* mpda_XValues;
// Holds the colour for the corresponding element in the x and y
// position
DynamicArray<double>* mpda_YValues;
// Holds the z position for the image (rows)
DynamicArray<double>* mpda_ZValues;
What things should I consider when creating a worker thread?
How might I create the thread using boost when all the data processing occurs in one method setData(){...}
?