scheduler 2.0.0 → 2.0.0.1
raw patch · 5 files changed
+28/−16 lines, 5 filesdep −template-haskell
Dependencies removed: template-haskell
Files
- LICENSE +1/−1
- README.md +3/−3
- scheduler.cabal +9/−8
- src/Control/Scheduler.hs +4/−4
- tests/doctests.hs +11/−0
LICENSE view
@@ -1,4 +1,4 @@-Copyright Alexey Kuleshevich (c) 2019+Copyright Alexey Kuleshevich (c) 2019-2021 All rights reserved.
README.md view
@@ -7,11 +7,11 @@ | Language | Github Actions | Coveralls |Gitter.im | |:--------:|:--------------:|:---------:|:--------:|-|  | [](https://github.com/lehins/haskell-scheduler/actions) | [](https://coveralls.io/github/lehins/haskell-scheduler?branch=master) | [](https://gitter.im/haskell-massiv/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)+|  | [](https://github.com/lehins/scheduler/actions) | [](https://coveralls.io/github/lehins/scheduler?branch=master) | [](https://gitter.im/haskell-massiv/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | Gihub | Hackage | Nightly | LTS | |:------|:-------:|:-------:|:---:|-| [`scheduler`](https://github.com/lehins/haskell-scheduler) | [](https://hackage.haskell.org/package/scheduler)| [](https://www.stackage.org/nightly/package/scheduler) | [](https://www.stackage.org/lts/package/scheduler) |+| [`scheduler`](https://github.com/lehins/scheduler) | [](https://hackage.haskell.org/package/scheduler)| [](https://www.stackage.org/nightly/package/scheduler) | [](https://www.stackage.org/lts/package/scheduler) | ## QuickStart@@ -36,7 +36,7 @@ In the example above two workers will be created to handle the only two jobs that have been scheduled. Printing with `putStr` is not thread safe, so the output that you would get with above-function is likely be interleaved:+function is likely to be interleaved: ```haskell λ> interleaveFooBar
scheduler.cabal view
@@ -1,5 +1,5 @@ name: scheduler-version: 2.0.0+version: 2.0.0.1 synopsis: Work stealing scheduler. description: A work stealing scheduler that is designed for parallelization of heavy work loads. It was primarily developed for [massiv](https://github.com/lehins/massiv) array library, but it is general enough to be useful for any computation that fits the model of few workers and many jobs. homepage: https://github.com/lehins/haskell-scheduler@@ -7,7 +7,7 @@ license-file: LICENSE author: Alexey Kuleshevich maintainer: alexey@kuleshevi.ch-copyright: 2018-2020 Alexey Kuleshevich+copyright: 2018-2021 Alexey Kuleshevich category: Parallelism, Concurrency build-type: Simple extra-source-files: README.md@@ -56,13 +56,14 @@ hs-source-dirs: tests main-is: doctests.hs build-depends: base- , doctest >=0.15- , mwc-random- , scheduler- , template-haskell- , vector+ if impl(ghc >= 8.2) && impl(ghc < 8.10)+ build-depends: doctest >=0.15+ , mwc-random+ , scheduler+ , vector default-language: Haskell2010 source-repository head type: git- location: https://github.com/lehins/haskell-scheduler+ location: https://github.com/lehins/scheduler+ subdir: scheduler
src/Control/Scheduler.hs view
@@ -104,10 +104,10 @@ -- -- ==== __Examples__ ----- A good example of using stateful workers would be generation of random number in--- parallel. A lof of times random number generators are not gonna be thread safe, so we--- can work around this problem, by using a separate stateful generator for each of the--- workers.+-- A good example of using stateful workers would be generation of random number+-- in parallel. A lof of times random number generators are not thread safe, so+-- we can work around this problem with a separate stateful generator for+-- each of the workers. -- -- >>> import Control.Monad as M ((>=>), replicateM) -- >>> import Control.Concurrent (yield, threadDelay)
tests/doctests.hs view
@@ -1,6 +1,17 @@+{-# LANGUAGE CPP #-} module Main where +#if __GLASGOW_HASKELL__ >= 802 && __GLASGOW_HASKELL__ < 810+ import Test.DocTest (doctest) main :: IO () main = doctest ["src"]++#else++-- TODO: fix doctest support+main :: IO ()+main = putStrLn "\nDoctests are not supported for ghc version 8.2 and prior as well as 8.10\n"++#endif