Giter Club home page Giter Club logo

haskell-lockfree-queue's Introduction

Contents of this Repository

This is a multi-package repository. The following directories correspond to the following packages:

CAS            - IORefCAS
AbstractDeque  - abstract-deque
MichaelScott   - lockfree-queue
ChaseLev       - chaselev-deques
MegaDeque      - mega-deque

Please see the .cabal files for descriptions of each package. Here's a brief summary:

  • CAS - Compare and swap operations for
  • AbstractDeque - abstract interface for single and double ended queues, plus reference implementation in pure Haskell
  • MichaelScott - classic Michael & Scott algorithm for single ended queues
  • ChaseLev - Work-stealing "1.5" ended deques.
  • MegaDeque - a package that picks the best implementation for the interface constraints, which are expressed at the type level.

How to Test and Install

First, to really use compare-and-swap based data structures, you should be using GHC 7.4.1 or later. These libaries will be force to "fake it" on earlier versions of GHC.

You can install all of the packages in your user's .cabal directory with the following command:

./install_all.sh

You may also want to build the tests at the same time:

./install_all.sh --enable-tests

There are currently [2012.02.29] some problems with cabal failing to automatically install dependencies for tests (as opposed to libraries). You may have to manually install some packages via cabal (e.g. test-framework-HUnit).

If you take a look at that install_all.sh script, you'll notice you can also configure which executables for cabal and ghc it uses, for example:

GHC=ghc-7.4.1 CABAL=cabal-0.10.2 ./install_all.sh --enable-tests

Next, you can run the tests like this:

./MichaelScott/dist/build/test-lockfree-queue/test-lockfree-queue

That test should complete successfully with a zero exit code.

Note that if you have trouble building test-suites through cabal, you can build them manually with GHC using a command like the following:

cd MichaelScott/
ghc-7.4.1 -O2 -threaded -rtsopts Test.hs -o Test.exe

KNOWN PROBLEMS

  • [2012.02.29] The tests for abstract-deque currently stack overflow, but pass with an increased (100M) stack size.

  • [2012.02.29] ChaseLev deques exhibit nondeterministic failures still. Hopefully this is due to a bug in the implementation and not further problems in Haskell's CAS (there was a fix AFTER ghc-7.2.1).

            TODO
    

  • It would be nice to add a binding to TBB concurrent queues or other foreign implementations (for storable types).

  • Test on windows. (It hasn't been tried.)

haskell-lockfree-queue's People

Contributors

acfoltzer avatar rrnewton avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.