Giter Site home page Giter Site logo

COW thread safety about croaring HOT 8 CLOSED

zenoyang avatar zenoyang commented on June 12, 2024 1
COW thread safety

from croaring.

Comments (8)

lemire avatar lemire commented on June 12, 2024 1

We are getting there.

On the plus side, when we release, we will have Visual Studio support.

Hang on !!!

from croaring.

zenoyang avatar zenoyang commented on June 12, 2024

The preliminary solution is to add pthread_mutex_t mutex variable in shared_container_s, and when the shared container is copied or free, the mutex variable is used for mutual exclusion. Avoid multiple threads modifying counter at the same time. After our POC verification, there is no problem with this solution. I hope you can refer to this plan and give suggestions.

from croaring.

lemire avatar lemire commented on June 12, 2024

Please review #473

from croaring.

zenoyang avatar zenoyang commented on June 12, 2024

Please review #473

Perfect. And I tested it in doris, and I didn't reproduce the assertion failure problem. thanks. @lemire

from croaring.

lemire avatar lemire commented on June 12, 2024

I have added tests. If it passes the sanitizer tests in CI, I will release.

from croaring.

SalvatorePreviti avatar SalvatorePreviti commented on June 12, 2024

Question - when #473 is landed, this means all COW operations are thread safe? If so would make sense to enable COW always and remove the flag?

from croaring.

lemire avatar lemire commented on June 12, 2024

The PR fixing this has been released.

from croaring.

lemire avatar lemire commented on June 12, 2024

If so would make sense to enable COW always and remove the flag?

That would be a major change that could affect lots of users. I think that the furthest we should go is have a global parameter that can change the default, but I think that COW should remain "opt-in"... unless/until there is widespread consensus that it is best. Even so, it should be done with lots of warning.

It is better not to break existing code.

from croaring.

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.