KStringHandler: stateless/reentrant/thread-safe?

Thiago Macieira thiago at kde.org
Sat Oct 27 06:44:23 BST 2012

On sexta-feira, 26 de outubro de 2012 21.06.35, Frank Reininghaus wrote:
> Yes, I thought the same, but then I wasn't entirely sure if all these
> functions really are thread-safe. Some of them have const static variables,
> which might be initialised the first time the function is called AFAIK. I
> don't know if that's guaranteed to work if the functions can be called from
> multiple threads. But you can probably answer that question

Caching some global information which could be recreated on every call is 
stateless and thread-safe.

If the static variable cannot be recreated on every call, it's stateful. That 
contradicts the documentation.

Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- 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://mail.kde.org/pipermail/kde-core-devel/attachments/20121026/90d838a8/attachment.sig>

More information about the kde-core-devel mailing list