Code Monkey home page Code Monkey logo

Comments (5)

bminixhofer avatar bminixhofer commented on May 22, 2024 2

Sure! Release CI is running for 0.6.3 now.

from nlprule.

bminixhofer avatar bminixhofer commented on May 22, 2024 1

Hi, thanks for the issue. Refreshingly, something which I couldn't have foreseen :)

I believe the easiest fix is just to replace lazycell with once_cell, which is a more well used dependency anyway and has the get_or_init API which fits our use case.

I went ahead and implemented this: #69. Can you check if this solves the problem? Binaries from the latest release should still work.

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

A bit of context:

Rules::suggest(...) is called in parallel over a shard immutable reference to a single &Rules instance. Looking into lazycell the ordering semantics look ok from the first glance, the API usage just seems incorrect (even in their example).

If thread A calls borrow() while thread B is just about to write the value to the UnsafeCell, it will be in LOCK state, which will return a None.
The only way I can think of doing this correctly is calling borrow() repeatedly in the else case until it succeeds.

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

Just had a peek into the once_cell crate, and there is a significant amount of non trivial synchronization logic happening, but I ran it a few times and it works consistently 🎉 - so #69 is good to go :) Thanks for the fast turnaround 👍

from nlprule.

drahnr avatar drahnr commented on May 22, 2024

Could you craft a release, that's the last thing pending for a cargo-spellcheck 0.8.0 which is again needed for paritytech/parity-bridges-common#832

from nlprule.

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.