Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a possible solution for unlocking the GVL #91

Open
Maaarcocr opened this issue Oct 9, 2023 · 0 comments
Open

a possible solution for unlocking the GVL #91

Maaarcocr opened this issue Oct 9, 2023 · 0 comments

Comments

@Maaarcocr
Copy link
Contributor

Hi! I've seen in past issues that possibly allowing the GVL to be unlocked for rust functions would be something that magnus may do in the future. I've recently prototyped a way to do so in https://github.com/Maaarcocr/lucchetto

I was wondering if there would be any interest in mainlining that approach here, as I think it can be pretty useful to be able to decide if you want to hold the gvl lock or not.

I know that there are some safety concerns around unlocking the GVL and for that I made a small marker trait which is implemented for types that I deem to be safe to be passed in/out of functions that do not hold the GVL. Now this does not entirely disallow calling into ruby, but it's a nice first step.

For now it only works for free functions, as they are easier to make safe.

Anyway, I would be happy to scratch that repo and port the code here if there is interest! I think it works nicely.

I also recognise that the code is very young and it makes use of unsafe quite a bit, but I'm sure with some additional time spent on it we could make sure it's all good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant