[Interest] QtQuick2 scenegraph render thread access

Sletta Gunnar Gunnar.Sletta at digia.com
Wed Jul 10 16:21:40 CEST 2013



On 9. juli 2013, at 15:18, "Preet" <prismatic.project at gmail.com> wrote:

> Hi,
> 
> In my application I have a custom QQuickItem that has time varying parameters which are input externally from the C++ side of things. When the QQuickItem renders, it grabs these parameters using a callback function that shares memory with the main thread, so I need to protect any shared memory with mutexes.
> 
> With a high frame rate (60fps) and high data input rate (20-100ms) there's a lot of mutex locking going on. I'd rather have a proxy QObject that holds a copy of the data in the QtQuick rendering thread, so I can use signals instead of mutexes.
> 
> * Is the scene graph rendering thread a normal QThread with an event loop?
> * If so, is there a way to get a pointer to it?
> 
> If I'm delving into implementation-specific territory and what I'm doing is a bad idea, are there any better ways to do what I'm after?
> 
QThread::currentThread() during QQuickItem::updatePaintNode() for instance.. 

Or ask the thread from the QQuickWindow::openGLContext(), after the scenegraph has started rendering.

It is a QThread and does support event processing, but why don't you just synchronize your state during updatePaintNode when the gui thread is already blocked.

Cheers,
Gunnar

> 
> Preet
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



More information about the Interest mailing list