3 ms·
"If you've got the control necessary to automatically STM things, you might as well just equally-automatically copy the Jython-style locking." So far thinking
by fijall 15y ago
"If you've got the control necessary to automatically STM things, you might as well just equally-automatically copy the Jython-style locking."
So far thinking about how to really do that automatically failed. Do you feel like providing an idea?
- jerf 15y agoFailed for CPython or failed for PyPy? I'm just going on the claim that PyPy is in a position to automatically add STM, per that blog post. If in fact it can't automatically add locks, it isn't going to be automatically adding STM either and this is all a moot discussion.
- jholman 15y agoAdding fine-grained locks without risking deadlock is pretty tricky. Perhaps too tricky for automatic addition. As I (shallowly) understand it, STM doesn't introduce deadlock threats, so it requires less-amazing feats to add it automatically. Note, again, that the FA does admit that using STM will perform more poorly than fine-grained locking, and he only hopes that it will scale well enough that extra cores will pay for it. As I understand it, one of the reasons for the GIL is that it makes it easier to write C extensions (especially as compared with fine-grained locking, which is not friendly to extensions), and I'm not sure, but I think the STM scheme preserves this property?