I want to use a string in a thread. Because the thread is only reading the string, I would prefer not to add a lock for reading the string.
So, I thought about storing a copy of the string inside the thread class.
What the best way to duplicate a string (and make sure the real data is actually copied, not just refcounted) ?
Well yes, I wrote it to be thread-safe. But I’ve never quite trusted it for some reason… I just never quite feel safe without a critical section being involved.