Raise priority of the main "event loop" thread

The goal is to improve responsiveness of qbt when CPU resources are scarce.

Instead of lowering libtorrent threads priority, it is chosen to raise main event loop thread
priority to avoid getting messy with libtorrent internals.

Also on Windows, threads doesn't inherit thread priority from the parent thread and it always
use the default (normal) priority.

PR #17278.
This commit is contained in:
Chocobo1
2022-07-02 14:57:47 +08:00
committed by GitHub
parent b44bdd21cb
commit 25b3f2d1a6
2 changed files with 23 additions and 2 deletions

View File

@@ -136,8 +136,13 @@ private:
void processParams(const QStringList &params);
void runExternalProgram(const BitTorrent::Torrent *torrent) const;
void sendNotificationEmail(const BitTorrent::Torrent *torrent);
#ifdef QBT_USES_LIBTORRENT2
void applyMemoryWorkingSetLimit();
void applyMemoryWorkingSetLimit() const;
#endif
#ifdef Q_OS_WIN
void adjustThreadPriority() const;
#endif
#ifndef DISABLE_GUI