[Development] drawhelpers thread-safe?

Thiago Macieira thiago.macieira at intel.com
Mon Jan 2 13:52:35 CET 2012


On Monday, 2 de January de 2012 06.38.17, gunnar.sletta at nokia.com wrote:
> On Dec 30, 2011, at 6:34 PM, ext Thiago Macieira wrote:
> > They don't look like they are thread-safe, at least not the
> > qInitDrawHelperAsm function.
> > 
> > Is that function supposed to be thread-safe?
> 
> It is supposed to be and originally was.
> 
> The qInitDrawHelperAsm function should only be called from the
> QGuiApplication / QApplication constructor before any drawing happens and
> then never again so it is safe.
> 
> However, I notice that the qInitDrawHelperAsm function is also called from
> qt_memfill32/16_seutp, used for instance by QImage::fill(), which is there
> used to replace the implementation of the qt_memfill32/16 with a SIMD
> version of itself before calling itself again. Given that QApp already ran
> once and replaced the qt_memfill with another function this code is in
> practice almost never run. My guess is that someone added this so that one
> could start fiddling with images before the QApplication was constructed
> and still get the benefits of SSE.
> 
> In practice I doubt we'll run into a problem with it, but a saner solution
> would be to initialize the two setup function pointers to the the non-simd
> defaults and rely on QApp to get SSE.

Thanks, I'll see what I can do.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120102/af222efe/attachment.sig>


More information about the Development mailing list