Giter Club home page Giter Club logo

Comments (4)

tomtomjhj avatar tomtomjhj commented on June 6, 2024 2

Relaxed at 133 is fine because head loaded from 133 is not dereferenced. The actual value to be dereferenced is acquired-swapped at 135.

Also actually the load at 124 can be relaxed (thanks to release sequence). And .next field can be non-atomic.

should use Acquire to observe other modifications made to this memory address

release-acquire synchronization is about conditionally passing the knowledge about other locations, not the location that is being stored to and loaded from.

from crossbeam.

taiki-e avatar taiki-e commented on June 6, 2024 1

May I submit a pull request?

I'm not interested in accepting an optimization patch for a 7 year old release, but I would be willing to accept a patch to the latest version.

from crossbeam.

wang384670111 avatar wang384670111 commented on June 6, 2024

release-acquire synchronization is about conditionally passing the knowledge about other locations, not the location that is being stored to and loaded from.

I agree. My initial thought is that the location stored by AtomicPtr is a pointer, yet the content it points to is non-atomic. Indeed, line 137 does not perform dereferencing; I was mistaken. It appears I need to revise the detection pattern.

from crossbeam.

wang384670111 avatar wang384670111 commented on June 6, 2024

Hm, I've updated the detection pattern, successfully eliminating the false positive.

let head = self.head.load(Acquire);

Regarding the use of ordering, my detector can identify it as well. Here are the results. May I submit a pull request?

  {
    "AtomicCorrelationViolation": {
      "bug_kind": "AtimicCorrelationViolation",
      "possibility": "Possibly",
      "diagnosis": {
        "atomic": "/Users/wangcheng/.cargo/registry/src/index.crates.io-6f17d22bba15001f/crossbeam-0.2.12/src/mem/epoch/garbage.rs:124:34: 124:47"
      },
      "explanation": "Using an atomic operation with a stronger memory ordering than necessary can lead to unnecessary performance overhead. Using Relaxed is sufficient to ensure the correctness of the program"
    }
  },

from crossbeam.

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.