Commit 124c546
committed
Update to 0.0.4-SNAPSHOT
- Add AreaDependentQueue
AreaDependentQueue is capable of dynamically ordering tasks
scheduled (possibly) onto overlapping x/y coordinates. For
a given coordinate, only one task at most is being executed.
- Add stream id (long) to PrioritisedExecutor
This will be later used by thread pools that may perform different
scheduling depending on the stream id. For example, it may be
possible that tasks with a lower stream id are executed before
other tasks, or that tasks with different stream ids are shared
equally. At this stage, I've not yet decided.
- Add BalancedPrioritisedThreadPool
This thread pool will share time equally between groups but will
not share time equally between queues within the groups. The task
execution order is determined by priority then by suborder. This
results is more fair task execution as determined by queue size
(i.e more tasks in one queue should generally receive more time).
- Rewrite spinwait logic in PrioritisedQueueExecutorThread
1. Do not yield and park immediately upon emptying the queue
Instead, set the parked field. This allows wakeup to occur if
a task is queued while short parking.
2. Only spinwait if configured to
- Fix PrioritisedQueueExecutorThread#close(wait=true, ...) not waiting
Need to only break when the thread dies. Forgot to invert the alive
check.
- Add COWArrayList
The underlying array is not Object[] but is actually of the
element type. The list also works only through reference equality
as well. The array is retrievable for faster iteration.
- Change coordinates from x/z to x/y coordinates in ReentrantAreaLock
- Use AtomicLong for size is ConcurrentLong2ReferenceChainedHashTable
We really don't see any benefit from using LongAdder since on
additions we need to sum over the entire adder (defeating the
purpose of splitting the additions for parallelism). There should
be a minor improvement in put/remove performance, even in contended
scenarios.
- Remove ConcurrentUtil#rethrow
Use ThrowUtil#throwUnchecked
- Remove PrioritisedThreadPool
Use BalancedPrioritisedThreadPool, or in the future even
StreamOrderedThreadPool1 parent f150999 commit 124c546
File tree
22 files changed
+2793
-946
lines changed- gradle/wrapper
- src/main/java/ca/spottedleaf/concurrentutil
- collection
- executor
- queue
- thread
- list
- lock
- map
- scheduler
- util
22 files changed
+2793
-946
lines changedBinary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | | - | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
1134 | 1134 | | |
1135 | 1135 | | |
1136 | 1136 | | |
1137 | | - | |
| 1137 | + | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
| |||
1154 | 1154 | | |
1155 | 1155 | | |
1156 | 1156 | | |
1157 | | - | |
| 1157 | + | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | 1160 | | |
| |||
Lines changed: 52 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
101 | 102 | | |
102 | | - | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| 135 | + | |
133 | 136 | | |
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
139 | | - | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | 145 | | |
142 | 146 | | |
| |||
220 | 224 | | |
221 | 225 | | |
222 | 226 | | |
223 | | - | |
| 227 | + | |
224 | 228 | | |
225 | 229 | | |
226 | 230 | | |
| |||
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
235 | | - | |
| 239 | + | |
236 | 240 | | |
237 | 241 | | |
238 | 242 | | |
| |||
257 | 261 | | |
258 | 262 | | |
259 | 263 | | |
260 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
261 | 271 | | |
262 | 272 | | |
263 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
264 | 285 | | |
| 286 | + | |
265 | 287 | | |
266 | | - | |
267 | | - | |
| 288 | + | |
| 289 | + | |
268 | 290 | | |
269 | | - | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
270 | 313 | | |
271 | 314 | | |
0 commit comments