How many threads created for QML Application by default ?
-
Hi All,
I have seen in qt documentation that a single thread(GUI thread) is created by program at start-up.
But i could see bunch of thread in main() function. Can someone help me understand it ?Please find the screenshots for reference,
Here i could see around 8 threads created
-
@jsulm : I got the answer after posting in mailing list, Thanks for your direction.
Here is the answer for my query,
Qt may spawn additional threads internally. ~100% of the time, they're
invisible to the developer, and used just by Qt for its own purposes. In
other words, the code you're going to write will run in the main thread
and you'll never know about the other threads. Just ignore their existence.QtQuick has one special thread of you should aware of, which is its
rendering thread. If you plan to do custom drawing, in C++, using
QtQuick APIs, then the docs will tell you about this rendering thread
and how to avoid shooting yourself in the foot. But if you just use
QtQuick from QML, or use C++ drawing bits that aren't related to QtQuick
(like QImage, then again everything will be ran in the main/GUI thread. -
@Vinoth-Rajendran4 : Any help guys on this topic
-
@Vinoth-Rajendran4 I suggest to ask on Qt developers mailing list. People there know Qt internals better.
-
@jsulm : I could see lot of lists in qt mailing page(https://lists.qt-project.org/admin). Can you help me as to which list I need to ask my queries to ?
Thanks for the reply
-
-
@jsulm : I got the answer after posting in mailing list, Thanks for your direction.
Here is the answer for my query,
Qt may spawn additional threads internally. ~100% of the time, they're
invisible to the developer, and used just by Qt for its own purposes. In
other words, the code you're going to write will run in the main thread
and you'll never know about the other threads. Just ignore their existence.QtQuick has one special thread of you should aware of, which is its
rendering thread. If you plan to do custom drawing, in C++, using
QtQuick APIs, then the docs will tell you about this rendering thread
and how to avoid shooting yourself in the foot. But if you just use
QtQuick from QML, or use C++ drawing bits that aren't related to QtQuick
(like QImage, then again everything will be ran in the main/GUI thread.