-
Notifications
You must be signed in to change notification settings - Fork 2
/
atomic-counter.cabal
185 lines (163 loc) · 3.46 KB
/
atomic-counter.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
cabal-version: 3.0
-- Created : 29 December 2022
name:
atomic-counter
version:
0.1.2.2
synopsis:
Mutable counters that can be modified with atomic operatinos
description:
This package defines Counter type that can be safely modified
concurrently from multiple threads. The type supports only few
operations, namely read, write, cas (compare and swap), add,
subtract and a few bitwise ones like or, and xor.
Most common use case is having a shared counter that multiple
threads increment. Another potential use case is lightweight locks.
copyright:
(c) Sergey Vinokurov 2022
license:
Apache-2.0
license-file:
LICENSE
author:
Sergey Vinokurov
maintainer:
Sergey Vinokurov <[email protected]>
category:
Concurrency, Data, Data Structures
tested-with:
GHC == 8.6,
GHC == 8.8,
GHC == 8.10,
GHC == 9.2,
GHC == 9.4,
GHC == 9.6,
GHC == 9.8,
GHC == 9.10
build-type:
Simple
extra-source-files:
Changelog.md
Readme.md
homepage:
https://github.com/sergv/atomic-counter
bug-reports:
https://github.com/sergv/atomic-counter/issues
source-repository head
type: git
location: https://github.com/sergv/atomic-counter.git
flag dev
description:
Enable development flags like -Werror and linting
default:
False
manual:
True
flag no-cmm
description:
Don't use cmm implementation
default:
False
manual:
True
common ghc-options
default-language:
Haskell2010
ghc-options:
-Weverything
-Wno-all-missed-specialisations
-Wno-implicit-prelude
-Wno-missed-specialisations
-Wno-missing-import-lists
-Wno-missing-local-signatures
-Wno-safe
-Wno-type-defaults
-Wno-unsafe
if impl(ghc >= 8.8)
ghc-options:
-Wno-missing-deriving-strategies
if impl(ghc >= 8.10)
ghc-options:
-Wno-missing-safe-haskell-mode
-Wno-prepositive-qualified-module
if impl(ghc >= 9.2)
ghc-options:
-Wno-missing-kind-signatures
if impl(ghc >= 9.8)
ghc-options:
-Wno-missing-role-annotations
-Wno-missing-poly-kind-signatures
library
import: ghc-options
exposed-modules:
Control.Concurrent.Counter
Control.Concurrent.Counter.Lifted.IO
Control.Concurrent.Counter.Lifted.ST
Control.Concurrent.Counter.Unlifted
hs-source-dirs:
src
build-depends:
, base >= 4.12 && < 5
if impl(ghc >= 9.4) && !arch(javascript) && !arch(i386) && !flag(no-cmm)
cmm-sources:
Counter.cmm
cpp-options:
-DUSE_CMM
if flag(dev)
ghc-options:
-dcmm-lint
library test-utils
import: ghc-options
visibility:
private
exposed-modules:
TestUtils
hs-source-dirs:
test
build-depends:
, QuickCheck
, async >= 2
, base >= 4.12 && < 5
test-suite test
import: ghc-options
type:
exitcode-stdio-1.0
main-is:
test/TestMain.hs
hs-source-dirs:
.
build-depends:
, QuickCheck
, atomic-counter
, base >= 4.12
, tasty
, tasty-quickcheck
, atomic-counter:test-utils
ghc-options:
-rtsopts
-threaded
"-with-rtsopts=-N -A32M"
-main-is TestMain
benchmark bench
import: ghc-options
type:
exitcode-stdio-1.0
main-is:
bench/BenchMain.hs
hs-source-dirs:
.
build-depends:
, QuickCheck
, atomic-counter
, base >= 4.12
, primitive
, stm
, tasty >= 1.4.2
, tasty-bench >= 0.3.4
, tasty-quickcheck
, atomic-counter:test-utils
ghc-options:
-rtsopts
-threaded
"-with-rtsopts=-N -A32M"
-main-is BenchMain