3 ms·
> At the interpreter level, as the article mentions, it suffices to lock the structures down That's a sufficient, but not necessary condition. The idea of STM
by tomp 15y ago
> At the interpreter level, as the article mentions, it suffices to lock the structures down
That's a sufficient, but not necessary condition. The idea of STM is to provide just the necessary protection, and nothing more, so that even multiple threads can manipulate the same structure simultaneously, as long as they don't manipulate the same properties/parts of this structure.
Having said that, I don't claim that the way (P|J)ython is written, there is any unnecessary protection going on, furthermore, to fully ensure that just the necessary protection is on, a lot of code may have to be rewritten.