Unsolved QThreadpool/QRunnable blocking
-
Does it block directly on the first tryStart call ?
-
Yes, first tryStart call.
-
How long does it block ?
You're runnable being pretty short and quick to do, you might just see it done sooner that what you expect.
-
This post is deleted! -
@SGaist Execution stops after that.
-
What do you mean by stop ?
Does your application hang or crashes ? -
The application hangs.
-
Made a couple of tweaks and turned on some print statements in a different part of the app (a different slot triggered by QTimer).
It almost looks like slotTask just stops printing to the console and log file.
-
void HelloWorldTask::run() { qDebug() << "Hello world from thread" << QThread::currentThread(); }
@John-Howe Does your implementation contains these statements only in run method? or any while loop ?
-
@John-Howe the
qDebug
stream is serialized internally, which is what @nagesh is alluding to, I imagine. That notwithstanding, you should just interrupt the debugger when the program hangs, and extract a complete stack trace. Upload it somewhere/post it here, so we can take a look.