Commit 9e5ed87
committed
DPL: give each stream its own slot in the service registry
The registry derives a service's slot from the low 8 bits of
type.hash ^ valueFromSalt(salt), but valueFromSalt puts the streamId at bit 16,
so every stream lands on the same slot for a given service and fills up the
same MAX_DISTANCE-deep probe window -- after which registration is refused,
blaming whichever service lost the race rather than the one which filled the
window. Mix the salt into the low bits instead: only the starting slot changes
(valueFromSalt still carries key equality, and both getPos and registerService
go through instanceFromTypeSalt), and unlike widening the table this raises no
new ceiling. With DPL_THREADPOOL_SIZE=4, o2-test-framework-SimpleDataProcessingDevice01
goes from 0/20 runs passing to 14/20, and 17/20 at 8 streams where 9 entries
could not previously share a window of 8 at all.1 parent 6339a5a commit 9e5ed87
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
181 | 192 | | |
182 | 193 | | |
183 | 194 | | |
| |||
0 commit comments