You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a way to release the GVL/GIL? I saw in #12 that it wasn't in Magnus yet, but that was 2.5 years ago.
For reference, my use case is doing some extremely CPU intensive processing based on a filename, so no need to go back and forth with ruby objects. In principle I could handle this via a popen3 to a binary, but I quite like the ergonomics of using Magnus.
The text was updated successfully, but these errors were encountered:
KMarshland
changed the title
How to release the GIL?
How to release the GVL?
Jan 8, 2025
Magnus' original API wasn't compatible with (safely) implementing a function to release the GVL. It's been a slow process designing and then migrating functions from the old api design to one that will be able to support a safe implementation of releasing the GVL, so as yet there isn't the functionality built in to Magnus.
It is possible to implement it yourself via rb-sys, and I think if you do a web search you'll find a couple of people who have done this.
Thanks! As you said "as yet", I take it that it's in the roadmap? Awesome to hear (and thank you for your hard work on this library).
For others coming across this thread, the main thing I found here was https://github.com/Maaarcocr/lucchetto, though I don't use it myself (opting instead for spawning new processes).
Is there a way to release the GVL/GIL? I saw in #12 that it wasn't in Magnus yet, but that was 2.5 years ago.
For reference, my use case is doing some extremely CPU intensive processing based on a filename, so no need to go back and forth with ruby objects. In principle I could handle this via a
popen3
to a binary, but I quite like the ergonomics of using Magnus.The text was updated successfully, but these errors were encountered: