[Interest] QMap and thread-safe.

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Wed Jul 24 11:56:32 CEST 2013


A const method can't affect other threads, but other threads can

> affect a const method.
>
> Suppose a const function is reading a large data object. If the object
> wasn't locked, other threads could modify it while the first function
> is in the middle of reading it, potentially corrupting the result of
> the first function.
>

You're right. But I was asking about the specific senario the OP mentioned,
i.e with only readers operating on an object, no writers.

Thanks,
-mandeep


>
> Sze-Howe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130724/74674b9a/attachment.html>


More information about the Interest mailing list