HiGHS icon indicating copy to clipboard operation
HiGHS copied to clipboard

Python Interface should release the GIL when run gets called

Open michaelbynum opened this issue 1 year ago • 8 comments
trafficstars

The GIL prevents other python threads from running. Releasing it when run is called (and grabbing it again at the end of run) will allow other threads to proceed while HiGHS is running.

michaelbynum avatar Jan 25 '24 15:01 michaelbynum

Please assign me.

michaelbynum avatar Jan 25 '24 15:01 michaelbynum

Relatedly, HiGHS ignores keyboard interrupts. I assume that this is also due to how HiGHS gets called.

Sponge-Bas avatar Feb 23 '24 19:02 Sponge-Bas

Through highspy, I can well imagine that it does ignore keyboard interrupts

jajhall avatar Feb 23 '24 22:02 jajhall

Yes, I believe releasing the GIL will also fix the keyboard interrupt issue.

michaelbynum avatar Feb 26 '24 14:02 michaelbynum

Hello, may I ask whether this has been fixed? I'm sometimes experiencing similar problems. Thanks!

KelvinCheng5507 avatar Aug 19 '24 14:08 KelvinCheng5507

I did try to fix this, but my initial attempt was not successful. I'll give it another try today.

michaelbynum avatar Aug 19 '24 18:08 michaelbynum

Ahh... I think I see how to fix this.

michaelbynum avatar Aug 19 '24 18:08 michaelbynum

I've got the keyboard interrupt working. I'll create a PR shortly.

michaelbynum avatar Aug 19 '24 19:08 michaelbynum