[Development] Unnecessary ambiguity in Qt documentation about reentrancy and safety of const methods.

NIkolai Marchenko enmarantispam at gmail.com
Sun Jul 19 00:38:43 CEST 2026


I am not exactly sure if your wording covers the
qlocale::toDouble(string,bool&) or not.  aka non const but also partially
not same data.

On Sun, Jul 19, 2026 at 1:36 AM Giuseppe D'Angelo via Development <
development at qt-project.org> wrote:

> On 19/07/2026 00:19, NIkolai Marchenko wrote:
> >  >  to call the same function, on the same data, from multiple threads,
> > without synchronization, provided that any shared data is accessed
> > exclusively along const paths
> >
> > I think something went wrong with the wording here. "Same function, on
> > the same instance, from multiple threads..."
>
> "Same instance" is part of the "same data". For non-static member
> functions, the `this` pointer (the instance) belongs to the data the
> function is accessing.
>
> But I was imprecise on another axis: the extended contract means you can
> even call *different* functions on the same data, provided all those
> functions access shared data along const paths. This would be the case
> for e.g. different const methods of a class, being called at the same
> time on the same instance.
>
> My 2 c,
> --
> Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
> KDAB (France) S.A.S., a KDAB Group company
> Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
> KDAB - Trusted Software Excellence
> --
> Development mailing list
> Development at qt-project.org
> https://lists.qt-project.org/listinfo/development
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20260719/b2307e53/attachment.htm>


More information about the Development mailing list