Nick Coghlan added the comment:

Based on https://github.com/python/cpython/pull/2646/files#r126574323, I'm 
actually thinking along different lines: I'm starting to think we should move 
the current sys.modules to sys._modules, and make sys.modules a synchronised 
wrapper that does the following for all get/set/delete operations:

  # Acquires the global import lock
  # Acquires the relevant module lock
  # Releases the global import lock
  # Mutates sys._modules
  # Releases the module lock

That said, I'm not sure that would be sufficient to give the desired level of 
atomicity, so exposing ModuleLockManager may actually be a better approach.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30893>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to