monad-par 0.3.4.1 → 0.3.4.2
raw patch · 3 files changed
+26/−15 lines, 3 filesdep ~test-framework-quickcheck2PVP ok
version bump matches the API change (PVP)
Dependency ranges changed: test-framework-quickcheck2
API changes (from Hackage documentation)
Files
- Control/Monad/Par/Scheds/Direct.hs +14/−10
- monad-par.cabal +8/−4
- tests/ParTests.hs +4/−1
Control/Monad/Par/Scheds/Direct.hs view
@@ -73,10 +73,10 @@ -- [2012.08.30] This shows a 10X improvement on nested parfib: -- #define NESTED_SCHEDS #define PARPUTS--- #define FORKPARENT--- #define IDLING_ON+#define FORKPARENT+#define IDLING_ON -- Next, IF idling is on, should we do wakeups?:--- #define WAKEIDLE+#define WAKEIDLE -- #define WAIT_FOR_WORKERS @@ -380,10 +380,13 @@ -- waits. One reason for this is that the main/progenitor thread in -- GHC is expensive like a forkOS thread. ----------------------------------------- -- DEBUGGING -- --- takeMVar mfin -- Final value.--- dbgTakeMVar "global waiting thread" mfin -- Final value.- busyTakeMVar (" The global wait "++ show tidorig) mfin -- Final value. + -- DEBUGGING --+#ifdef DEBUG+ busyTakeMVar (" The global wait "++ show tidorig) mfin -- Final value.+-- dbgTakeMVar "global waiting thread" mfin -- Final value. +#else+ takeMVar mfin -- Final value.+#endif ---------------------------------------- -- Create the default scheduler(s) state:@@ -841,9 +844,10 @@ busyTakeMVar msg mv = try (10 * 1000 * 1000) where try 0 = do - tid <- myThreadId- -- After we've failed enough times, start complaining:- printf "%s not getting anywhere, msg: %s\n" (show tid) msg + when dbg $ do+ tid <- myThreadId+ -- After we've failed enough times, start complaining:+ printf "%s not getting anywhere, msg: %s\n" (show tid) msg try (100 * 1000) try n = do x <- tryTakeMVar mv
monad-par.cabal view
@@ -1,5 +1,5 @@ Name: monad-par-Version: 0.3.4.1+Version: 0.3.4.2 Synopsis: A library for parallel programming based on a monad @@ -19,11 +19,14 @@ -- 0.3.1 : fix for ghc 7.6.1, expose Par.IO -- 0.3.4 : switch to direct scheduler as default (only 1-level nesting allowed) -- 0.3.4.1 : fix build with GHC 7.0, and fix test+-- 0.3.4.2 : Bugfix, 0.3.4.1 was released with debugging switches flipped. Description: The 'Par' monad offers a simple API for parallel programming. The library works for parallelising both pure and @IO@ computations,- although only the pure version is deterministic.+ although only the pure version is deterministic. The default + implementation provides a work-stealing scheduler and supports+ forking tasks that are much lighter weight than IO-threads. . For complete documentation see "Control.Monad.Par". .@@ -35,7 +38,7 @@ * @abstract-par@ provides the type classes that abstract over different implementations of the @Par@ monad. .- * @monad-par-extras@ provides some extra combinators layered on top of+ * @monad-par-extras@ provides extra combinators and monad transformers layered on top of the @Par@ monad. . Changes in 0.3.4 relative to 0.3:@@ -143,7 +146,8 @@ , deepseq >= 1.2 , time , QuickCheck, HUnit- , test-framework-hunit, test-framework-quickcheck2+ , test-framework-hunit+ , test-framework-quickcheck2 >= 0.3 , test-framework, test-framework-th , abstract-deque >= 0.1.4
tests/ParTests.hs view
@@ -49,9 +49,12 @@ -- throw this exception, so we expect either the exception or a -- timeout. This is reasonable since we might expect a deadlock in a -- non-Trace scheduler. --ACF+-- +-- [2013.05.17] Update, it's also possible to get a blocked-indefinitely error here+-- --RRN case_getEmpty :: IO () case_getEmpty = do- _ <- timeout 100000 $ assertException ["no result", "timeout"] $ + _ <- timeout 100000 $ assertException ["no result", "timeout", "thread blocked indefinitely"] $ runPar $ do r <- new; get r return ()