Giter Club home page Giter Club logo

Comments (1)

nalimilan avatar nalimilan commented on June 11, 2024

Like in CategoricalArrays, the problem is that even if we took a lock on each setindex! call, calling getindex in parallel wouldn't be thread-safe if a new level is added (as the pool may be resized). Yet taking a lock on getindex would kill performance.

Also, taking a lock on each setindex! call would make it impossible to run it in parallel, yet that's perfectly safe if you know that you don't add many levels. Not sure whether it's a typical case or not, but that happens e.g. if you reorder values in the array (e.g. sorting).

What we can do without affecting performance is take a lock when adding new levels. That should at least fix the example you give, and adding levels is relatively slow and can't be done in parallel anyway. But that doesn't provide a lot of safety either.

from pooledarrays.jl.

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.