[Qt-interest] Handling translations in a multi-threaded server

Giuseppe D'Angelo dangelog at gmail.com
Thu May 19 14:09:18 CEST 2011


> Hi Konrad,
>
> Not at all.  I was coming to the same conclusion myself - load them all in a
> QHash<QString, QTranslator *>.  Luckily, the QTranslator::translate method
> is const, so multi-threaded access should not require locking.

The constness means nothing. It's not marked as reentrant or
thread-safe, therefore you must assume that it's not safe to use it
from multiple threads (with or without locking).

-- 
Giuseppe D'Angelo



More information about the Qt-interest-old mailing list