Skip to content
Snippets Groups Projects
  • Richard Berger's avatar
    1544b51d
    Support mixed Python use by honoring Python GIL · 1544b51d
    Richard Berger authored
    This enables support to both drive LAMMPS with a Python interpreter and
    evaluating Python expressions inside of LAMMPS using that same interpreter.
    Previously this has been avoided through an error message because the
    binding code did not ensure that the necessary GIL (global interpreter lock)
    structures exist (see issue #438).
    
    All code paths which call Python C API functions must first acquire the
    GIL through a call PyGILState_Ensure and release it with PyGILState_Release.
    1544b51d
    History
    Support mixed Python use by honoring Python GIL
    Richard Berger authored
    This enables support to both drive LAMMPS with a Python interpreter and
    evaluating Python expressions inside of LAMMPS using that same interpreter.
    Previously this has been avoided through an error message because the
    binding code did not ensure that the necessary GIL (global interpreter lock)
    structures exist (see issue #438).
    
    All code paths which call Python C API functions must first acquire the
    GIL through a call PyGILState_Ensure and release it with PyGILState_Release.