Hi!
I am trying to do almost the same thing as @bbui210 but I am using std::thread. I am facing the issue that it is behaving sequential and not parallel. My QT GUI (QT application) is in the main thread. My code structure is like below-
int process(arguments)
{
//processing and saving the data in a file
}
int main(arguments)
{
//GUI is called which accesses the file
std::thread threadObj(process, arguments_of_process);
threadObj.join();
}
int process(arguments)
{
//processing and saving the data in a file
}
int main(arguments)
{
//GUI is called which accesses the file
std::thread threadObj(process, arguments_of_process);
threadObj.join();
}
To copy to clipboard, switch view to plain text mode
I want my GUI to keep updating itself as file changes. My main reason for using std::thread was that it was easier to use and also I had to pass arguments to the function. Can someone tell me what is wrong with my code?
Thanks!!
Bookmarks