Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

Freeze in multithreaded program

$
0
0
Hi, I’ve been writing a small update software for a video game, using Qt 4.8. The software features a FTP client, a basic UI a some extensions (launch the game, etc). The source code is available on Github : https://github.com/arbonagw/UnrealUpdater . I’m experiencing weird UI freezes where it should not, so I’ll explain how it works. I’ve got a main class, Updater, that launches a second thread with a worker class, Downloader, that uses QNetworkAccessManager to download files. Here is the process : it starts by downloading a manifest file with a tree of file names along with MD5 hash ; then it computes a list of files to update by checking each of these files locally with their MD5, this work is done with QtConcurrent::run() ; after that, Updater sends a file name, Downloader signals when it’s done, and so on. when the list of files is empty, it starts the game. Now I’ve got three problems : while computing the MD5, checking the files, the UI is frozen. There is just no reason, it’s supposed to be done in a separate thread ; while downloading, I receive the “finished” event from QNetworkAccessManager in multiple occurrences. The first finished() is sent once, the second is sent twice, and so on. What he hell ? (my bad, found that out) the downloading process looks prone to freezing randomly while downloading (no downloading, but a responsive UI that can open dialogs when pressing buttons). I fail to understand how this is is failing. Can anyone help with the software structure ? What is actually wrong here ? Thanks !

Viewing all articles
Browse latest Browse all 18427

Trending Articles