mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-12-25 06:21:46 +03:00
parent
93d8cc64e3
commit
5f9ad29b1b
@ -13,58 +13,6 @@ description:
|
|||||||
already familiar with concurrent Haskell, just change all the
|
already familiar with concurrent Haskell, just change all the
|
||||||
imports from Control.Concurrent.* to Control.Concurrent.Classy.* and
|
imports from Control.Concurrent.* to Control.Concurrent.Classy.* and
|
||||||
fix the type errors.
|
fix the type errors.
|
||||||
.
|
|
||||||
A brief list of supported functionality:
|
|
||||||
.
|
|
||||||
* Threads: the @forkIO*@ and @forkOn*@ functions, although bound
|
|
||||||
threads are not supported.
|
|
||||||
.
|
|
||||||
* Getting and setting capablities.
|
|
||||||
.
|
|
||||||
* Yielding and delaying.
|
|
||||||
.
|
|
||||||
* Mutable state: STM, @MVar@, and @IORef@.
|
|
||||||
.
|
|
||||||
* Atomic compare-and-swap for @IORef@.
|
|
||||||
.
|
|
||||||
* Exceptions.
|
|
||||||
.
|
|
||||||
* All of the data structures in Control.Concurrent.* and
|
|
||||||
Control.Concurrent.STM.* have typeclass-abstracted equivalents.
|
|
||||||
.
|
|
||||||
* A reimplementation of the
|
|
||||||
<https://hackage.haskell.org/package/async async> package,
|
|
||||||
providing a higher-level interface over threads, allowing users to
|
|
||||||
conveniently run @MonadConc@ operations asynchronously and wait
|
|
||||||
for their results.
|
|
||||||
.
|
|
||||||
This is quite a rich set of functionality, although it is not
|
|
||||||
complete. If there is something else you need, file an issue!
|
|
||||||
.
|
|
||||||
This used to be part of dejafu, but with the dejafu-0.4.0.0 release,
|
|
||||||
it was split out into its own package.
|
|
||||||
.
|
|
||||||
== Why this and not something else?
|
|
||||||
.
|
|
||||||
* Why not base: like lifted-base, concurrency uses typeclasses to
|
|
||||||
make function types more generic. This automatically eliminates
|
|
||||||
calls to `lift` in many cases, resulting in clearer and simpler
|
|
||||||
code.
|
|
||||||
.
|
|
||||||
* Why not lifted-base: fundamentally, lifted-base is still using
|
|
||||||
actual threads and actual mutable variables. When using a
|
|
||||||
concurrency-specific typeclass, this isn't necessarily the case.
|
|
||||||
The dejafu library provides non-IO-based implementations to allow
|
|
||||||
testing concurrent programs.
|
|
||||||
.
|
|
||||||
* Why not IOSpec: IOSpec provides many of the operations this
|
|
||||||
library does, however it uses a free monad to do so, which has
|
|
||||||
extra allocation overhead. Furthermore, it does not expose enough
|
|
||||||
of the internals in order to accurately test real-execution
|
|
||||||
semantics, such as relaxed memory.
|
|
||||||
.
|
|
||||||
See the <https://github.com/barrucadu/dejafu README> for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
homepage: https://github.com/barrucadu/dejafu
|
homepage: https://github.com/barrucadu/dejafu
|
||||||
license: MIT
|
license: MIT
|
||||||
@ -74,7 +22,7 @@ maintainer: mike@barrucadu.co.uk
|
|||||||
-- copyright:
|
-- copyright:
|
||||||
category: Concurrency
|
category: Concurrency
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-source-files: CHANGELOG.markdown
|
extra-source-files: README.markdown CHANGELOG.markdown
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
@ -18,43 +18,6 @@ description:
|
|||||||
<https://hackage.haskell.org/package/concurrency concurrency>
|
<https://hackage.haskell.org/package/concurrency concurrency>
|
||||||
package by enabling you to systematically and deterministically test
|
package by enabling you to systematically and deterministically test
|
||||||
your concurrent programs.
|
your concurrent programs.
|
||||||
.
|
|
||||||
== Déjà Fu with 'IO':
|
|
||||||
.
|
|
||||||
The core assumption underlying Déjà Fu is that 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.
|
|
||||||
.
|
|
||||||
Whilst this assumption may not hold in general when 'IO' is
|
|
||||||
involved, you should strive to produce test cases where it does.
|
|
||||||
.
|
|
||||||
== Memory Model
|
|
||||||
.
|
|
||||||
The testing functionality supports a few different memory models,
|
|
||||||
for computations which use non-synchronised `CRef` operations. The
|
|
||||||
supported models are:
|
|
||||||
.
|
|
||||||
* __Sequential Consistency:__ A program behaves as a simple
|
|
||||||
interleaving of the actions in different threads. When a CRef is
|
|
||||||
written to, that write is immediately visible to all threads.
|
|
||||||
.
|
|
||||||
* __Total Store Order (TSO):__ Each thread has a write buffer. A
|
|
||||||
thread sees its writes immediately, but other threads will only
|
|
||||||
see writes when they are committed, which may happen later. Writes
|
|
||||||
are committed in the same order that they are created.
|
|
||||||
.
|
|
||||||
* __Partial Store Order (PSO):__ Each CRef has a write buffer. A
|
|
||||||
thread sees its writes immediately, but other threads will only
|
|
||||||
see writes when they are committed, which may happen later. Writes
|
|
||||||
to different CRefs are not necessarily committed in the same order
|
|
||||||
that they are created.
|
|
||||||
.
|
|
||||||
If a testing function does not take the memory model as a parameter,
|
|
||||||
it uses TSO.
|
|
||||||
.
|
|
||||||
See the <https://github.com/barrucadu/dejafu README> for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
homepage: https://github.com/barrucadu/dejafu
|
homepage: https://github.com/barrucadu/dejafu
|
||||||
license: MIT
|
license: MIT
|
||||||
@ -64,7 +27,7 @@ maintainer: mike@barrucadu.co.uk
|
|||||||
-- copyright:
|
-- copyright:
|
||||||
category: Concurrency
|
category: Concurrency
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-source-files: CHANGELOG.markdown
|
extra-source-files: README.markdown CHANGELOG.markdown
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
@ -11,9 +11,6 @@ description:
|
|||||||
<https://hackage.haskell.org/package/HUnit HUnit>. This lets you
|
<https://hackage.haskell.org/package/HUnit HUnit>. This lets you
|
||||||
easily incorporate concurrency testing into your existing test
|
easily incorporate concurrency testing into your existing test
|
||||||
suites.
|
suites.
|
||||||
.
|
|
||||||
See the <https://github.com/barrucadu/dejafu README> for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
homepage: https://github.com/barrucadu/dejafu
|
homepage: https://github.com/barrucadu/dejafu
|
||||||
license: MIT
|
license: MIT
|
||||||
@ -23,7 +20,7 @@ maintainer: mike@barrucadu.co.uk
|
|||||||
-- copyright:
|
-- copyright:
|
||||||
category: Testing
|
category: Testing
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-source-files: CHANGELOG.markdown
|
extra-source-files: README.markdown CHANGELOG.markdown
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
@ -11,9 +11,6 @@ description:
|
|||||||
<https://hackage.haskell.org/package/tasty tasty>. This lets you
|
<https://hackage.haskell.org/package/tasty tasty>. This lets you
|
||||||
easily incorporate concurrency testing into your existing test
|
easily incorporate concurrency testing into your existing test
|
||||||
suites.
|
suites.
|
||||||
.
|
|
||||||
See the <https://github.com/barrucadu/dejafu README> for more
|
|
||||||
details.
|
|
||||||
|
|
||||||
homepage: https://github.com/barrucadu/dejafu
|
homepage: https://github.com/barrucadu/dejafu
|
||||||
license: MIT
|
license: MIT
|
||||||
@ -23,7 +20,7 @@ maintainer: mike@barrucadu.co.uk
|
|||||||
-- copyright:
|
-- copyright:
|
||||||
category: Testing
|
category: Testing
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
extra-source-files: CHANGELOG.markdown
|
extra-source-files: README.markdown CHANGELOG.markdown
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
Loading…
Reference in New Issue
Block a user