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

Is it safe to have multiple versions of the jni crate in use within a single application? #422

Open
rib opened this issue Feb 16, 2023 · 1 comment
Milestone

Comments

@rib
Copy link
Contributor

rib commented Feb 16, 2023

This issue is really just a reminder to take some care to consider how safe it is to have multiple versions of the jni crate linked in a single application.

I don't currently know of any specific problem but it's something that's crossed my mind a number of times recently and I expect that it might not have been considered carefully before, so I don't feel confident that I understand the safety concerns (if any).

The use of TLS for attaching threads is probably the main thing that I wonder about.

Multiple versions of the jni crate will effectively have their own TLS state and maybe they could end up with a muddled understanding of which threads are attached to the JVM? - is that a safety concern?

Is there any static state, or other TLS usage to consider?

@rib rib added this to the 0.22 milestone Feb 23, 2023
@rib
Copy link
Contributor Author

rib commented Apr 1, 2023

Track this issue/discussion around thread attachment, where it's easy to see how the use of thread-local storage across different versions of the jni crate could be hazardous: #441

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