Originally Posted by
Shakti
But most importantly, before using concurrency to solve your issues you need to know exactly what issues you want to solve (that is, exactly what is taking up time in the code).
My code looks something like this:
- Take Data
- Convert through LUT
- Display data
Taking data is by far the most time-consuming, as the PCI card I take the data from needs to sync to an external camera with some given framerate. If I tell it to get a frame, it first waits for the sync signal and then takes the data. If I fire at 7.5fps, it will have to wait for the next pulse. That would be best suited for a different thread I believe.
The weird thing though is if I tell it to do something like this:
Code:
for (int i = 0; i < max_frames; i++)
{
//take data function
//convert through LUT function
//display through OpenGL function
}
It will only display the OpenGL frame once the loop is finished. This has to be some issue with Qt, because running this code:
Code:
for (int i = 0; i < 10; i++)
{
Sleep(1000);
textbrowser.append("random text");
}
It will hang until the loop is done, and then display whatever my string was 10 times all at once. So this is going to be way more complicated than I originally thought.