Git Product home page Git Product logo

Comments (4)

rrnewton avatar rrnewton commented on July 28, 2024

Thanks -- I'll take a look.

from haskell-lockfree.

cartazio avatar cartazio commented on July 28, 2024

I think this is resolved now that Ryan's sorted out the broken CPP, right? @rrnewton

from haskell-lockfree.

rrnewton avatar rrnewton commented on July 28, 2024

Yes, this was a horrible horrible bug (issue #15). It was falling through to the vanilla C, NONATOMIC implementations. Terrible! Worst possible thing for an atomic-primops library to do.

Fortunately, it's fixed now as of release 0.5.0.2, if you want to take another look @jberryman ...

Btw, there are similar test cases to this one in the repo, but it's interesting how this one uses "start" MVars. Presumably that's to allow the threads to migrate to other CPUs before blocking, and to thereby increase the degree they are contending? If this does bring the start-times of the threads closer together, we should change all our tests to use it.

from haskell-lockfree.

jberryman avatar jberryman commented on July 28, 2024

Well don't beat yourself up! Glad I could help, and looking forward to seeing where all this work leads.

Presumably that's to ... increase the degree they are contending?

Yeah, that was the idea although I didn't think too much about it to be honest. A more paranoid solution would be to have each forked thread block until all it's sibling worker threads have been forked, like:

do readyCount <- newTVar 0
     replicateM_ 2 $ forkIO $ incrementThenRetryUntilEqualsTwo readyCount >> doTest
     ...
     blockMainThreadUntilDone

It also might be advisable to force the cabal tests to fail with a message if run without -N2 or more (if that doesn't already happen).

from haskell-lockfree.

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.