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

Avoid force check Java thread in native side #2460

Closed
Yohahaha opened this issue Jul 25, 2023 · 0 comments
Closed

Avoid force check Java thread in native side #2460

Yohahaha opened this issue Jul 25, 2023 · 0 comments
Labels
enhancement New feature or request stale stale

Comments

@Yohahaha
Copy link
Contributor

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

Current implementation has lots of checks for whether current thread is origin Spark task thread, and we still add compromises to avoid that check, such as
https://github.com/oap-project/gluten/blob/218f1776514d9aada7a582c6bfc23ce4cadfa4fc/gluten-core/src/main/scala/org/apache/spark/util/TaskResources.scala#L45-L46
https://github.com/oap-project/gluten/blob/6b93602cd26bc1e29fd8f11d60714d06ebc39d19/cpp/core/utils/TaskContext.cc#L58-L64

It bring much complexity and over design.

Describe the solution you'd like

When first JNI call occurs, native side convert local ref to a global ref and hold it, then we can call JVM from native side and access origin Spark task's object we created before by this ref.

Simplify JNI layer complexity.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@Yohahaha Yohahaha added the enhancement New feature or request label Jul 25, 2023
@github-actions github-actions bot added the stale stale label Nov 18, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale stale
Projects
None yet
Development

No branches or pull requests

1 participant