Skip to content

How to add event handlers #193

Answered by AntoinePrv
CharJon asked this question in Questions
Discussion options

You must be logged in to vote

Hi @CharJon,

I think I understand what is going on. Python has a Global Interpreter Lock (GIL) that constraint it to be single threaded. When executing native (e.g. C/C++) code, this lock can be lifted to allow threading, which is what Ecole does.

PySCIPOpt however does not make this assumption. So when Ecole solves the Model, the Python event handler eventually gets called but the GIL is never locked...

I have send a PR to PySCIPOpt to ensure the GIL is locked (you can already use it without it getting merged).
It should work, but our PySCIPOpt interface in Ecole still has a few rough edges... For instance, in your DualBoundObservation, you would now get

ReferenceError

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CharJon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants