On Fri, Oct 27, 2017 at 9:45 AM, Elvis Stansvik <[email protected]> wrote:
>
> QMap isn't thread safe, so I don't think your use is guaranteed to be
> safe, even if you're only reading.
>

You're right, in the formal sense of the word, but if there are no
`mutable` members or `const_cast` usage a reentrant class can be used from
different threads IF the calls are read-only. I sometimes use `QHash` like
this where I need to read from a pre-populated hash from different threads,
with the understanding there's no need to lock something if the memory is
never changed.
_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to