Giter VIP home page Giter VIP logo

Comments (8)

Toilal avatar Toilal commented on July 20, 2024

I think it is not supposed to be thread-safe, and you have to synchronyze read/write methods from JDBM collections. (java.util.HashMap is not thread-safe also ...)

from jdbm3.

jankotek avatar jankotek commented on July 20, 2024

Collectios should be thread safe and this is a bug. I am going to fix it soon.

from jdbm3.

Toilal avatar Toilal commented on July 20, 2024

Sorry about that :). Then I hope there will be no impact on performance for single threaded access.

from jdbm3.

jankotek avatar jankotek commented on July 20, 2024

no impact on performance for single threaded access.

JDBM3 uses read/write locks, so there is some overhead for single threaded apps. But this overhead is minimal compared to others (diskIO, serialization..).

My main priority is performance with single thread access, and I am not going to complicate design to gain a few % on multicore tests.

from jdbm3.

ajermakovics avatar ajermakovics commented on July 20, 2024

I've seen that jdbm2 has a THREAD_SAFE option. Perhaps that could be added to DBMaker

from jdbm3.

jankotek avatar jankotek commented on July 20, 2024

THREAD_SAFE in JDBM2 is fragment from previous versions and is not really used. Overhead of creating and maintaining this option would also be bigger then benefits. As I said overhead of synchronization is very small.

In future I may start using preprocessor which would remove locks and produce single-thread-optimized jar.

from jdbm3.

ajermakovics avatar ajermakovics commented on July 20, 2024

Fair enough. What's interesting is that if both threads use the same instance of the map, everything works.

from jdbm3.

jankotek avatar jankotek commented on July 20, 2024

Fixed, problem was caused by two different instances of 'Map', now it uses weak reference to garantee only single instance

from jdbm3.

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.