Git Product home page Git Product logo

Comments (5)

rrnewton avatar rrnewton commented on July 28, 2024

You have to compile with -threaded.

Honestly, I don't know the right way to fix this. GHC only links the concurrency stuff into the RHS when you compile with -threaded. But these foreign primops depend on that. To my knowledge there is NOT a way to throw a more meaningful compile time error, because this is an error not at compile time per se, but in the final link phase.

Alternatively, we could rip out and duplicate the parts of the RTS we depend on (e.g. architecture portable CAS).

from haskell-lockfree.

rrnewton avatar rrnewton commented on July 28, 2024

I went ahead and made this warning prominent on the main package page:

http://hackage.haskell.org/package/atomic-primops-0.2.2.1

I'm working on a hack to duplicate the RTS functionality...

from haskell-lockfree.

rrnewton avatar rrnewton commented on July 28, 2024

This should be fixed as of the GHC 0.3 release. I took the approach of duplicating the necessary GHC RTS functionality so atomic-primops should work without -threaded now.

http://hackage.haskell.org/package/atomic-primops-0.3

I've tried it on linux and Mac but I haven't tested on Windows yet.

There is a makefile to test with several different "ways" that I've been using (profiling, optimization, -threaded):

https://github.com/rrnewton/haskell-lockfree-queue/blob/d6d3e9eda2a487a5f055b1f51423954bb6b6bdfa/AtomicPrimops/testing/Makefile#L28

Please re-open this if you still have a problem.

from haskell-lockfree.

robstewart57 avatar robstewart57 commented on July 28, 2024

I'm afraid not. I program using Data.Atomics does compile and run without -threaded. However, it does not work with GHCi which was, strictly speaking, the issue raised. Try loading the following .hs file in to GHCI;

import Data.Atomics
main = writeBarrier

Then:

Prelude> :l NonThreaded-CL.hs
*Main> main
...
Loading package atomic-primops-0.3 ... linking ... <interactive>: ~/.cabal/lib/atomic-primops-0.3/ghc-7.6.1/HSatomic-primops-0.3.o: unknown symbol `cas'

Then call main. You should still see the error. I am using HEAD, as of 10 minutes ago.

from haskell-lockfree.

robstewart57 avatar robstewart57 commented on July 28, 2024

It looks like this is going to be fixed in issue #10

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.