|
|
|
|
|
by pdonis
2687 days ago
|
|
> Simplest scenario, the read-increment-write cycle with 2 threads. Even with a mutex, it is still possible to have data race, if the lock is on per operation level. What you're describing is not "serialized access with a data race"; it's "multi-thread access that you didn't explicitly control properly". > For the second part, yep, it is a mistake, not processes, but threads. Ok, that clarifies things. > the active thread is free to modify those data structures without fear of data races, and there is no explicit locking required, if it doesn't hold its own copies of those interpreter internal states. I'm not sure I see why a thread would want to hold copies of those interpreter internal states, since if it did the issue would not be modifying them properly but having the local copies get out of sync with the interpreter's copies, since other threads can also mutate the latter. |
|