Systematic concurrency testing meets Haskell.
Go to file
Michael Walker c4eefd4849 Avoid decisions which will immediately block.
If a decision will immediately block without changing the global state, then
there is no point in making it: no state will become reachable from it which
isn't reachable through some other option we have available.

This has three parts:

 - When the prefix runs out and the scheduler is making decisions, it filters
   out decisions which will immediately block.

 - When a subtree is being added, it records which decisions will immediately
   block.

 - When backtracking points are being added, it filters out ones in this block
   list.

This optimisation is likely to only be useful when threads are communicating a
lot. For instance, a `parMap id` is totally unaffected by this, but the test
cases drop from an average of 64 runs to 42.
2015-07-20 16:16:46 +01:00
Control More transformer instances (inc. strict versions) 2015-05-30 01:45:20 +01:00
Data/List Use schedule bounding as the primary SCT approach. 2015-06-19 16:50:51 +01:00
Test Avoid decisions which will immediately block. 2015-07-20 16:16:46 +01:00
tests Make the stmAtomic test actually test STM atomicity 2015-07-08 18:18:18 +01:00
.gitignore Stackify 2015-07-19 04:39:39 +01:00
dejafu.cabal Implement BPOR for SCT, return to listy predicates. 2015-07-16 22:32:30 +01:00
LICENSE Switch to MIT license 2015-03-13 14:58:42 +00:00
README.markdown Use Jenkins instead of Travis. 2015-07-19 12:20:18 +01:00
Setup.hs Initial commit: a class for monads providing concurrency. 2014-12-18 11:03:17 +00:00
stack.yaml Stackify 2015-07-19 04:39:39 +01:00

dejafu Build Status

Concurrency is nice, deadlocks and race conditions not so much. The Par monad family, as defined in abstract-par provides deterministic parallelism, but sometimes we can tolerate a bit of nondeterminism.

This package provides a class of monads for potentially nondeterministic concurrency, with an interface very much in the spirit of Par, but slightly more relaxed. Specifically, MonadConc's IVar equivalent, CVars, can be written to multiple times.

The documentation of the latest developmental version is available online.

MonadConc and IO

The intention of the MonadConc class is to provide concurrency where any apparent nondeterminism arises purely from the scheduling behaviour. To put it another way, a given computation, parametrised with a fixed set of scheduling decisions, is deterministic. This assumption is used by the testing functionality provided by Control.Monad.Conc.SCT.

Whilst this assumption may not hold in general when IO is involved, you should strive to produce test cases where it does.

Contributing

Bug reports, pull requests, and comments are very welcome!

Feel free to contact me on GitHub, through IRC (#haskell on freenode), or email (mike@barrucadu.co.uk).