You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -104,7 +104,7 @@ tests and further documentation are to follow when time allows.
104
104
105
105
[The full API documentation is kept up-to-date on GitHub.](https://nim-works.github.io/loony/loony.html)
106
106
107
-
[The API documentation for the Ward submodule is found here.](https://nim-works.github.io/loony/loony/ward.html)
107
+
[~~The API documentation for the Ward submodule is found here.~~](https://nim-works.github.io/loony/loony/ward.html)~~*Wards are untested and are unlikely to remain in the library*~~
108
108
109
109
#### Memory Safety & Cache Coherence
110
110
@@ -114,6 +114,19 @@ committed on the push operation and read on the pop operation; this is a
114
114
higher-cost primitive. You can use `unsafePush` and `unsafePop` to manipulate
115
115
a `LoonyQueue` without regard to cache coherency for ultimate performance.
116
116
117
+
The LoonyQueue itself is padded across cachelines, and by default, the slots
118
+
are read and written to in a cyclic fashion over cachelines to reduce false
119
+
sharing.
120
+
121
+
```
122
+
Visual representation of rotating index
123
+
124
+
| 64 bytes | 64 bytes | 64 bytes |...
125
+
| 0------- | 1------- | 2------- |...
126
+
| -63------| -64------| -65------|...
127
+
|--127-----|--128-----|--129-----|...
128
+
```
129
+
117
130
### Debugging
118
131
119
132
Pass `--d:loonyDebug` in compilation or with a config nimscript to use debug
@@ -140,8 +153,20 @@ debugNodeCounter:
140
153
We recommend against changing these values unless you know what you are doing. The suggested max alignment is 16 to achieve drastically higher contention capacities. Compilation will fail if your alignment does not fit the slot count index.
141
154
142
155
`-d:loonyNodeAlignment=11` - Adjust node alignment to increase/decrease contention capacity
156
+
143
157
`-d:loonySlotCount=1024` - Adjust the number of slots in each node
144
158
159
+
`-d:loonyDebug=false` - Toggle debug counters and templates, see
160
+
[debugging](#debugging). False by default.
161
+
162
+
`-d:loonyRotate=true` - Toggle the index for the slots of
163
+
loony queue to be read over cacheline bounds in a cyclic
164
+
manner. True by default.
165
+
166
+
> While loonyRotate is enabled, the slot count must be a
167
+
> power of 2. Error messages will indicate whether this
168
+
> is a cause of compilation failure.
169
+
145
170
## What are Continuations?
146
171
147
172
If you've somehow missed the next big thing for nim; see [CPS](https://github.com/nim-works/cps)
0 commit comments