I ran some performance measurements on the reader side, no write
updates, for a plain linked list traversal, 2 slightly different consequential rcu traversals, and traversals using hazard
pointers w/o and w/ a store/load memory barrier.
Timings are per node access.ÿ Depth is the size of the list.
count=100000 depth=10
base: elapsed =ÿÿÿÿ 723888 (ÿÿ 1528564)
avg =ÿ 0.72389 nsecs ( 1.52856 cycles)
cseq1: elapsed =ÿÿÿÿ 739503 (ÿÿ 1561812)
avg =ÿ 0.73950 nsecs ( 1.56181 cycles)
cseq2: elapsed =ÿÿÿÿ 730236 (ÿÿ 1542272)
avg =ÿ 0.73024 nsecs ( 1.54227 cycles)
hzptr: elapsed =ÿÿÿ 1718280 (ÿÿ 3628992)
avg =ÿ 1.71828 nsecs ( 3.62899 cycles)
hzptr_mb: elapsed =ÿÿ 10886003 (ÿ 22990944)
avg = 10.88600 nsecs (22.99094 cycles)
base: elapsed =ÿÿÿÿ 397189 (ÿÿÿ 838878)
avg =ÿ 0.39719 nsecs ( 0.83888 cycles)
cseq1: elapsed =ÿÿÿÿ 634696 (ÿÿ 1340486)
avg =ÿ 0.63470 nsecs ( 1.34049 cycles)
cseq2: elapsed =ÿÿÿÿ 617216 (ÿÿ 1303568)
avg =ÿ 0.61722 nsecs ( 1.30357 cycles)
hzptr: elapsed =ÿÿÿ 1271179 (ÿÿ 2684724)
avg =ÿ 1.27118 nsecs ( 2.68472 cycles)
hzptr_mb: elapsed =ÿÿÿ 8771772 (ÿ 18525744)
avg =ÿ 8.77177 nsecs (18.52574 cycles)
count=10000 depth=200
base: elapsed =ÿÿÿ 2887587 (ÿÿ 6098462)
avg =ÿ 1.44379 nsecs ( 3.04923 cycles)
cseq1: elapsed =ÿÿÿ 2919783 (ÿÿ 6166530)
avg =ÿ 1.45989 nsecs ( 3.08326 cycles)
cseq2: elapsed =ÿÿÿ 2742185 (ÿÿ 5791448)
avg =ÿ 1.37109 nsecs ( 2.89572 cycles)
hzptr: elapsed =ÿÿÿ 2875948 (ÿÿ 6073948)
avg =ÿ 1.43797 nsecs ( 3.03697 cycles)
hzptr_mb: elapsed =ÿÿ 15943183 (ÿ 33671514)
avg =ÿ 7.97159 nsecs (16.83576 cycles)
base: elapsed =ÿÿÿ 2093758 (ÿÿ 4421978)
avg =ÿ 1.04688 nsecs ( 2.21099 cycles)
cseq1: elapsed =ÿÿÿ 2191755 (ÿÿ 4628948)
avg =ÿ 1.09588 nsecs ( 2.31447 cycles)
cseq2: elapsed =ÿÿÿ 2130060 (ÿÿ 4498648)
avg =ÿ 1.06503 nsecs ( 2.24932 cycles)
hzptr: elapsed =ÿÿÿ 2334867 (ÿÿ 4931194)
avg =ÿ 1.16743 nsecs ( 2.46560 cycles)
hzptr_mb: elapsed =ÿÿ 14738172 (ÿ 31126590)
avg =ÿ 7.36909 nsecs (15.56330 cycles)
Given the restrictions, consequential rcu
seems to be on par with hazard pointers.
RCU isn't needed.Sigh.
On 11/27/2026 10:03 AM, Bonita Montero wrote:You said that you understand my idea.
RCU isn't needed.
Sigh.
Am 27.11.2026 um 22:00 schrieb Chris M. Thomasson:
On 11/27/2026 10:03 AM, Bonita Montero wrote:
RCU isn't needed.
Sigh.You said that you understand my idea.
Now I'm sure you don't.
I ran some performance measurements on the reader side, no write
updates, for a plain linked list traversal, 2 slightly different consequential rcu traversals, and traversals using hazard
pointers w/o and w/ a store/load memory barrier.
Timings are per node access.ÿ Depth is the size of the list.
count=100000 depth=10
base: elapsed =ÿÿÿÿ 723888 (ÿÿ 1528564)
avg =ÿ 0.72389 nsecs ( 1.52856 cycles)
cseq1: elapsed =ÿÿÿÿ 739503 (ÿÿ 1561812)
avg =ÿ 0.73950 nsecs ( 1.56181 cycles)
cseq2: elapsed =ÿÿÿÿ 730236 (ÿÿ 1542272)
avg =ÿ 0.73024 nsecs ( 1.54227 cycles)
hzptr: elapsed =ÿÿÿ 1718280 (ÿÿ 3628992)
avg =ÿ 1.71828 nsecs ( 3.62899 cycles)
hzptr_mb: elapsed =ÿÿ 10886003 (ÿ 22990944)
avg = 10.88600 nsecs (22.99094 cycles)
base: elapsed =ÿÿÿÿ 397189 (ÿÿÿ 838878)
avg =ÿ 0.39719 nsecs ( 0.83888 cycles)
cseq1: elapsed =ÿÿÿÿ 634696 (ÿÿ 1340486)
avg =ÿ 0.63470 nsecs ( 1.34049 cycles)
cseq2: elapsed =ÿÿÿÿ 617216 (ÿÿ 1303568)
avg =ÿ 0.61722 nsecs ( 1.30357 cycles)
hzptr: elapsed =ÿÿÿ 1271179 (ÿÿ 2684724)
avg =ÿ 1.27118 nsecs ( 2.68472 cycles)
hzptr_mb: elapsed =ÿÿÿ 8771772 (ÿ 18525744)
avg =ÿ 8.77177 nsecs (18.52574 cycles)
count=10000 depth=200
base: elapsed =ÿÿÿ 2887587 (ÿÿ 6098462)
avg =ÿ 1.44379 nsecs ( 3.04923 cycles)
cseq1: elapsed =ÿÿÿ 2919783 (ÿÿ 6166530)
avg =ÿ 1.45989 nsecs ( 3.08326 cycles)
cseq2: elapsed =ÿÿÿ 2742185 (ÿÿ 5791448)
avg =ÿ 1.37109 nsecs ( 2.89572 cycles)
hzptr: elapsed =ÿÿÿ 2875948 (ÿÿ 6073948)
avg =ÿ 1.43797 nsecs ( 3.03697 cycles)
hzptr_mb: elapsed =ÿÿ 15943183 (ÿ 33671514)
avg =ÿ 7.97159 nsecs (16.83576 cycles)
base: elapsed =ÿÿÿ 2093758 (ÿÿ 4421978)
avg =ÿ 1.04688 nsecs ( 2.21099 cycles)
cseq1: elapsed =ÿÿÿ 2191755 (ÿÿ 4628948)
avg =ÿ 1.09588 nsecs ( 2.31447 cycles)
cseq2: elapsed =ÿÿÿ 2130060 (ÿÿ 4498648)
avg =ÿ 1.06503 nsecs ( 2.24932 cycles)
hzptr: elapsed =ÿÿÿ 2334867 (ÿÿ 4931194)
avg =ÿ 1.16743 nsecs ( 2.46560 cycles)
hzptr_mb: elapsed =ÿÿ 14738172 (ÿ 31126590)
avg =ÿ 7.36909 nsecs (15.56330 cycles)
Given the restrictions, consequential rcu
seems to be on par with hazard pointers.
On 11/27/2026 9:31 AM, Joseph Seigh wrote:[...]
I ran some performance measurements on the reader side, no write
updates, for a plain linked list traversal, 2 slightly different
consequential rcu traversals, and traversals using hazard
pointers w/o and w/ a store/load memory barrier.
Timings are per node access.ÿ Depth is the size of the list.
count=10000 depth=200
base: elapsed =ÿÿÿ 2887587 (ÿÿ 6098462)
avg =ÿ 1.44379 nsecs ( 3.04923 cycles)
cseq1: elapsed =ÿÿÿ 2919783 (ÿÿ 6166530)
avg =ÿ 1.45989 nsecs ( 3.08326 cycles)
cseq2: elapsed =ÿÿÿ 2742185 (ÿÿ 5791448)
avg =ÿ 1.37109 nsecs ( 2.89572 cycles)
hzptr: elapsed =ÿÿÿ 2875948 (ÿÿ 6073948)
avg =ÿ 1.43797 nsecs ( 3.03697 cycles)
hzptr_mb: elapsed =ÿÿ 15943183 (ÿ 33671514)
avg =ÿ 7.97159 nsecs (16.83576 cycles)
base: elapsed =ÿÿÿ 2093758 (ÿÿ 4421978)
avg =ÿ 1.04688 nsecs ( 2.21099 cycles)
cseq1: elapsed =ÿÿÿ 2191755 (ÿÿ 4628948)
avg =ÿ 1.09588 nsecs ( 2.31447 cycles)
cseq2: elapsed =ÿÿÿ 2130060 (ÿÿ 4498648)
avg =ÿ 1.06503 nsecs ( 2.24932 cycles)
hzptr: elapsed =ÿÿÿ 2334867 (ÿÿ 4931194)
avg =ÿ 1.16743 nsecs ( 2.46560 cycles)
hzptr_mb: elapsed =ÿÿ 14738172 (ÿ 31126590)
avg =ÿ 7.36909 nsecs (15.56330 cycles)
Given the restrictions, consequential rcu
seems to be on par with hazard pointers.
Seems so! Even faster on some runs?
On 11/28/2026 2:14 PM, Chris M. Thomasson wrote:
On 11/27/2026 9:31 AM, Joseph Seigh wrote:[...]
I ran some performance measurements on the reader side, no write
updates, for a plain linked list traversal, 2 slightly different
consequential rcu traversals, and traversals using hazard
pointers w/o and w/ a store/load memory barrier.
Timings are per node access.ÿ Depth is the size of the list.
count=10000 depth=200
base: elapsed =ÿÿÿ 2887587 (ÿÿ 6098462)
avg =ÿ 1.44379 nsecs ( 3.04923 cycles)
cseq1: elapsed =ÿÿÿ 2919783 (ÿÿ 6166530)
avg =ÿ 1.45989 nsecs ( 3.08326 cycles)
cseq2: elapsed =ÿÿÿ 2742185 (ÿÿ 5791448)
avg =ÿ 1.37109 nsecs ( 2.89572 cycles)
hzptr: elapsed =ÿÿÿ 2875948 (ÿÿ 6073948)
avg =ÿ 1.43797 nsecs ( 3.03697 cycles)
hzptr_mb: elapsed =ÿÿ 15943183 (ÿ 33671514)
avg =ÿ 7.97159 nsecs (16.83576 cycles)
base: elapsed =ÿÿÿ 2093758 (ÿÿ 4421978)
avg =ÿ 1.04688 nsecs ( 2.21099 cycles)
cseq1: elapsed =ÿÿÿ 2191755 (ÿÿ 4628948)
avg =ÿ 1.09588 nsecs ( 2.31447 cycles)
cseq2: elapsed =ÿÿÿ 2130060 (ÿÿ 4498648)
avg =ÿ 1.06503 nsecs ( 2.24932 cycles)
hzptr: elapsed =ÿÿÿ 2334867 (ÿÿ 4931194)
avg =ÿ 1.16743 nsecs ( 2.46560 cycles)
hzptr_mb: elapsed =ÿÿ 14738172 (ÿ 31126590)
avg =ÿ 7.36909 nsecs (15.56330 cycles)
Given the restrictions, consequential rcu
seems to be on par with hazard pointers.
Seems so! Even faster on some runs?
cseq2 seems to be the best for those runs. Humm... How many threads are involved? One per core? Try a list depth of say 1000000?
say count 10000000, depth 1000000.
Also, you really should try another test where there are writers humming along. Technically you should be able to have the writers pushing and popping. But, the lock-free stack should never need an ABA counter
because the RCU aspect should never allow a node to be pushed back in
before its quiescent.
I am not sure if you understand your idea and/or RCU...
Am 28.11.2026 um 21:35 schrieb Chris M. Thomasson:
I am not sure if you understand your idea and/or RCU...
I understand both and you just don't understand my idea.
I do. I still want to see it be used for a test where there are a lot of reader threads iterating a lock-free stack while writers are actively mutating the stack. Your readers should never need to use StoreLoad
membars or any atomic RMW's, right?
Am 29.11.2026 um 09:29 schrieb Chris M. Thomasson:
I do. I still want to see it be used for a test where there are a lot
of reader threads iterating a lock-free stack while writers are
actively mutating the stack. Your readers should never need to use
StoreLoad membars or any atomic RMW's, right?
RCU, or my alternative, has nothing to do with lock-free stacks.
And based on your "criticism," I am quite certain that you haven't
understood my idea. Why don't you try describing it in your own words.
On 11/29/2026 12:37 AM, Bonita Montero wrote:
Am 29.11.2026 um 09:29 schrieb Chris M. Thomasson:
I do. I still want to see it be used for a test where there are a lot
of reader threads iterating a lock-free stack while writers are
actively mutating the stack. Your readers should never need to use
StoreLoad membars or any atomic RMW's, right?
RCU, or my alternative, has nothing to do with lock-free stacks.
And based on your "criticism," I am quite certain that you haven't
understood my idea. Why don't you try describing it in your own words.
Ever heard of using RCU to iterate a linked data structure without any locks, atomic RMW's or StoreLoad membars? The readers go full steam
ahead while writers can be actively mutating the list. RCU can do it
fine. Can yours?
Ever heard of using RCU to iterate a linked data structureI don't know which pattern you're talking about. But with my idea
without any locks, atomic RMW's or StoreLoad membars? ..
Am 29.11.2026 um 09:43 schrieb Chris M. Thomasson:
Ever heard of using RCU to iterate a linked data structure
without any locks, atomic RMW's or StoreLoad membars? ..
I don't know which pattern you're talking about. But with my idea
everything which is possible with RCU works also the way I did.
The memory consumtion of having multiple versions of the data
around is the same, but with my idea you've an immediate reclaim
when the last participant abandons ist.
Now describe the fast path of my idea !
On 11/28/2026 2:26 PM, Chris M. Thomasson wrote:...
On 11/28/2026 2:14 PM, Chris M. Thomasson wrote:
On 11/27/2026 9:31 AM, Joseph Seigh wrote:
cseq2 seems to be the best for those runs. Humm... How many threads
are involved? One per core? Try a list depth of say 1000000?
say count 10000000, depth 1000000.
Also, you really should try another test where there are writers
humming along. Technically you should be able to have the writers
pushing and popping. But, the lock-free stack should never need an ABA
counter because the RCU aspect should never allow a node to be pushed
back in before its quiescent.
Also, for your hazard pointer test, are you doing its logic on a per
node basis during iteration?
| Sysop: | Tetrazocine |
|---|---|
| Location: | Melbourne, VIC, Australia |
| Users: | 3 |
| Nodes: | 8 (0 / 8) |
| Uptime: | 51:06:46 |
| Calls: | 223 |
| Files: | 21,513 |
| Messages: | 83,425 |