KStringHandler: stateless/reentrant/thread-safe?

Frank Reininghaus frank78ac at googlemail.com
Fri Oct 26 20:06:35 BST 2012


Hi Thiago,

Am 26.10.2012 20:42 schrieb "Thiago Macieira":
>
> On sexta-feira, 26 de outubro de 2012 20.15.46, Frank Reininghaus wrote:
> > KStringHandler [3] say that "The methods here are completely
> > stateless", which sounds a bit vague. Does anyone mind if I add "This
> > function is reentrant" to the docs of
>
> Isn't that a bit redundant? If it's stateless, it has no state to
conflict with
> other threads, so it's thread-safe by definition.
>
> But I'd be in favour of *replacing* the stateless mention with just saying
> that they're thread-safe.

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 ;-)

Best regards,
Frank
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20121026/9a0d4f6b/attachment.htm>


More information about the kde-core-devel mailing list