in reply to Re^2: threads::shared - when to lock a hash ?
in thread threads::shared - when to lock a hash ?
so you don't need to lock it to avoid a corrupted value.
It's possible that the ops return junk if all the lock does is avoid corruption. I'm not sure this answers anything.
For starters, does a hash have one iterator per thread or just one iterator? each and possibly keys aren't safe if it's the latter.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: threads::shared - when to lock a hash ?
by dave_the_m (Monsignor) on Oct 17, 2011 at 06:47 UTC | |
by ikegami (Patriarch) on Oct 17, 2011 at 06:57 UTC | |
by choroba (Cardinal) on Oct 17, 2011 at 10:30 UTC |