Code Monkey home page Code Monkey logo

Comments (5)

koutheir avatar koutheir commented on May 28, 2024

Did you consider, as a possible solution, the usage of generation-based (also known as versioned) pointers? This seems like a possible (and possibly efficient) solution to the issue.

For more information, please take a look at the slotmap crate.

from jni-rs.

dmitry-timofeev avatar dmitry-timofeev commented on May 28, 2024

Did you consider, as a possible solution, the usage of generation-based (also known as versioned) pointers? This seems like a possible (and possibly efficient) solution to the issue.

No, have not had a change to use them. Are they supposed to be significantly more efficient than, say, a proper concurrent hash map, allowing both concurrent reads and writes?

Our present code uses a simple mutex-protected HashMap, but we consider using a concurrent hash map. However, this feature is mostly oriented at developers working on the project to catch bugs during development early, so performance is not an issue.

from jni-rs.

koutheir avatar koutheir commented on May 28, 2024

Are they supposed to be significantly more efficient than, say, a proper concurrent hash map, allowing both concurrent reads and writes?

I would say they can be more efficient, but benchmarking is the ultimate answer.

from jni-rs.

dmitry-timofeev avatar dmitry-timofeev commented on May 28, 2024

Q0: Is it useful to all users?

Given our experience in EJB; some feedback from people who got this wrong; and the feedback from our tutorial project, I think yes, it shall be added, either as a sister crate, or as a module within this crate.

A battle-tested implementation already exists in EJB under Apache 2.0, so we can pull it from here, with an appropriate notice on 3rd-party code.

from jni-rs.

MolotovCherry avatar MolotovCherry commented on May 28, 2024

I'd appreciate something like this honestly. It definitely would make things safer / easier when dealing with native pointers. Having a way to manage this from the Java side is very attractive, as it's likely much faster and "native"

from jni-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.