lockfree-queue 0.2.3 → 0.2.3.1
raw patch · 4 files changed
+41/−36 lines, 4 filesdep +lockfree-queue
Dependencies added: lockfree-queue
Files
- Data/Concurrent/Queue/MichaelScott.hs +5/−3
- Test.hs +0/−31
- lockfree-queue.cabal +5/−2
- tests/Test.hs +31/−0
Data/Concurrent/Queue/MichaelScott.hs view
@@ -24,7 +24,6 @@ import Data.ByteString.Char8 (hPutStrLn, pack) -- import GHC.Types (Word(W#))-import GHC.Prim (sameMutVar#) import GHC.IORef(IORef(IORef)) import GHC.STRef(STRef(STRef)) @@ -33,11 +32,14 @@ -- GHC 7.8 changed some primops #if MIN_VERSION_base(4,7,0)-import GHC.Base hiding ((==#))-import GHC.Prim hiding ((==#))+import GHC.Base hiding ((==#), sameMutVar#)+import GHC.Prim hiding ((==#), sameMutVar#) import qualified GHC.PrimopWrappers as GPW (==#) :: Int# -> Int# -> Bool (==#) x y = case x GPW.==# y of { 0# -> False; _ -> True }++sameMutVar# :: MutVar# s a -> MutVar# s a -> Bool+sameMutVar# x y = case GPW.sameMutVar# x y of { 0# -> False; _ -> True } #else import GHC.Base import GHC.Prim
− Test.hs
@@ -1,31 +0,0 @@-{-# LANGUAGE BangPatterns, NamedFieldPuns #-}-{- Example build:- ghc --make Test.hs -o Test.exe -rtsopts -fforce-recomp--}-module Main where-import Test.Framework (defaultMain)-import Test.Framework.Providers.HUnit (hUnitTestToTests)-import Data.Concurrent.Deque.Tests (tests_fifo, numElems, getNumAgents)-import System.Environment (getArgs, withArgs)-import Test.HUnit ---- import Data.Concurrent.Queue.MichaelScott (newQ)-import Data.Concurrent.Queue.MichaelScott (LinkedQueue)-import Data.Concurrent.Deque.Class (newQ)-import Data.Concurrent.Deque.Debugger--main = do- numAgents <- getNumAgents- putStrLn$ "Running with numElems "++show numElems++" and numAgents "++ show numAgents- putStrLn "Use NUMELEMS and +RTS to control the size of this benchmark."- args <- getArgs- -- Don't allow concurent tests (the tests are concurrent!):- withArgs (args ++ ["-j1","--jxml=test-results.xml"]) $ - defaultMain$ hUnitTestToTests$- TestList- [ TestLabel "MichaelScott" $ tests_fifo (newQ :: IO (LinkedQueue a))- , TestLabel "MichaelScott(DbgWrapper)" $- tests_fifo (newQ :: IO (DebugDeque LinkedQueue a))- ]--
lockfree-queue.cabal view
@@ -1,5 +1,5 @@ Name: lockfree-queue-Version: 0.2.3+Version: 0.2.3.1 License: BSD3 License-file: LICENSE Author: Ryan R. Newton@@ -51,8 +51,11 @@ Test-Suite test-lockfree-queue type: exitcode-stdio-1.0+ hs-source-dirs: ./tests/ main-is: Test.hs- build-depends: base >= 4.4.0.0 && < 5, bytestring, + build-depends: lockfree-queue+ build-depends: base >= 4.4.0.0 && < 5, + bytestring, abstract-deque >= 0.3, abstract-deque-tests >= 0.3, HUnit, test-framework, test-framework-hunit, ghc-prim, atomic-primops >= 0.6
+ tests/Test.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE BangPatterns, NamedFieldPuns #-}+{- Example build:+ ghc --make Test.hs -o Test.exe -rtsopts -fforce-recomp+-}+module Main where+import Test.Framework (defaultMain)+import Test.Framework.Providers.HUnit (hUnitTestToTests)+import Data.Concurrent.Deque.Tests (tests_fifo, numElems, getNumAgents)+import System.Environment (getArgs, withArgs)+import Test.HUnit ++-- import Data.Concurrent.Queue.MichaelScott (newQ)+import Data.Concurrent.Queue.MichaelScott (LinkedQueue)+import Data.Concurrent.Deque.Class (newQ)+import Data.Concurrent.Deque.Debugger++main = do+ numAgents <- getNumAgents+ putStrLn$ "Running with numElems "++show numElems++" and numAgents "++ show numAgents+ putStrLn "Use NUMELEMS and +RTS to control the size of this benchmark."+ args <- getArgs+ -- Don't allow concurent tests (the tests are concurrent!):+ withArgs (args ++ ["-j1","--jxml=test-results.xml"]) $ + defaultMain$ hUnitTestToTests$+ TestList+ [ TestLabel "MichaelScott" $ tests_fifo (newQ :: IO (LinkedQueue a))+ , TestLabel "MichaelScott(DbgWrapper)" $+ tests_fifo (newQ :: IO (DebugDeque LinkedQueue a))+ ]++