git.iko.soy/distributed-process
on master help sign in
Merge branch 'development' of github.com:haskell-distributed/distributed-process into development
commit69f3da29cde1f6cdf25326f5ae1c680d838a9576 authorTim Watson <watson.timothy@gmail.com> dateSun 20 Apr 2014, 08:57 (13 years ago) parent02c02a8b5d070d
3 files changed+20−8
distributed-process.cabal+10−3 src/Control/Distributed/Process/Internal/StrictMVar.hs+5 src/Control/Distributed/Process/Management/Table.hs+5−5
distributed-process.cabal+10−3
@@ -44,7 +44,6 @@ flag prof
4444Library
4545 Build-Depends: base >= 4.4 && < 5,
4646 binary >= 0.5 && < 0.8,
47− deepseq >= 1.3.0.1 && < 1.4,
4847 hashable >= 1.2.0.5 && < 1.3,
4948 network-transport >= 0.3 && < 0.4,
5049 stm >= 2.4 && < 2.5,
@@ -52,7 +51,6 @@ Library
5251 mtl >= 2.0 && < 2.2,
5352 data-accessor >= 0.2 && < 0.3,
5453 bytestring >= 0.9 && < 0.11,
55− containers >= 0.4 && < 0.6,
5654 old-locale >= 1.0 && < 1.1,
5755 time >= 1.2 && < 1.5,
5856 random >= 1.0 && < 1.1,
@@ -99,8 +97,17 @@ Library
9997 BangPatterns
10098 ghc-options: -Wall
10199 HS-Source-Dirs: src
100+ if impl(ghc <= 7.4.2)
101+ Build-Depends: containers >= 0.4 && < 0.5,
102+ deepseq == 1.3.0.0
103+ else
104+ Build-Depends: containers >= 0.4 && < 0.6,
105+ deepseq >= 1.3.0.1 && < 1.4
102106 if flag(th)
103− Build-Depends: template-haskell >= 2.6 && < 2.9
107+ if impl(ghc <= 7.4.2)
108+ Build-Depends: template-haskell >= 2.7 && < 2.8
109+ else
110+ Build-Depends: template-haskell >= 2.6 && < 2.9
104111 Exposed-modules: Control.Distributed.Process.Internal.Closure.TH
105112 CPP-Options: -DTemplateHaskellSupport
106113
src/Control/Distributed/Process/Internal/StrictMVar.hs+5
@@ -6,6 +6,7 @@ module Control.Distributed.Process.Internal.StrictMVar
66 , newMVar
77 , takeMVar
88 , putMVar
9+ , readMVar
910 , withMVar
1011 , modifyMVar_
1112 , modifyMVar
@@ -21,6 +22,7 @@ import qualified Control.Concurrent.MVar as MVar
2122 , newMVar
2223 , takeMVar
2324 , putMVar
25+ , readMVar
2426 , withMVar
2527 , modifyMVar_
2628 , modifyMVar
@@ -44,6 +46,9 @@ takeMVar (StrictMVar v) = MVar.takeMVar v
4446putMVar :: StrictMVar a -> a -> IO ()
4547putMVar (StrictMVar v) x = evaluate x >> MVar.putMVar v x
4648
49+readMVar :: StrictMVar a -> IO a
50+readMVar (StrictMVar v) = MVar.readMVar v
51+
4752withMVar :: StrictMVar a -> (a -> IO b) -> IO b
4853withMVar (StrictMVar v) = MVar.withMVar v
4954
src/Control/Distributed/Process/Management/Table.hs+5−5
@@ -49,8 +49,8 @@ import Control.Distributed.Process.Serializable (Serializable)
4949import Control.Monad.IO.Class (liftIO)
5050import Data.Accessor (Accessor, accessor, (^=), (^:))
5151import Data.Binary (Binary)
52−import Data.Map.Strict (Map)
53−import qualified Data.Map.Strict as Map
52+import Data.Map (Map)
53+import qualified Data.Map as Map
5454import Data.Typeable (Typeable)
5555
5656import GHC.Generics
@@ -181,7 +181,7 @@ startTableCoordinator fork = run Map.empty
181181 , _entries = Map.empty
182182 }
183183 (pid, _) <- spawnSup $ tableHandler initState
184− return $ (pid, Map.insert mxId pid tblMap)
184+ return $ (pid, mxId `seq` pid `seq` Map.insert mxId pid tblMap)
185185
186186 spawnSup proc = do
187187 us <- getSelfPid
@@ -204,8 +204,8 @@ tableHandler state = do
204204 where
205205 handleTableRequest _ Delete = return Nothing
206206 handleTableRequest st Purge = return $ Just $ (entries ^= Map.empty) $ st
207− handleTableRequest st (Clear k) = return $ Just $ (entries ^: Map.delete k) $ st
208− handleTableRequest st (Set k v) = return $ Just $ (entries ^: Map.insert k v) st
207+ handleTableRequest st (Clear k) = return $ Just $ (entries ^: (k `seq` Map.delete k)) $ st
208+ handleTableRequest st (Set k v) = return $ Just $ (entries ^: (k `seq` v `seq` Map.insert k v)) st
209209 handleTableRequest st (Get k c) = getEntry k c st >> return (Just st)
210210
211211getEntry :: String