2023-01-10

fanf: (Default)

https://dotat.at/@/2023-01-10-qsbr.html

At the end of October, I finally got my multithreaded qp-trie working! It could be built with two different concurrency control mechanisms:

  • A reader/writer lock

    This has poor read-side scalability, because every thread is hammering on the same shared location. But its write performance is reasonably good: concurrent readers don't slow it down too much.

  • liburcu, userland read-copy-update

    RCU has a fast and scalable read side, nice! But on the write side I used rcu_synchronize(), which is blocking and rather slow, so my write performance was terrible.

OK, but I want the best of both worlds! To fix it, I needed to change the qp-trie code to use safe memory reclamation more effectively: instead of blocking inside rcu_synchronize() before cleaning up, use call_rcu() to clean up asynchronously. I expect I'll write about the qp-trie changes another time.

Another issue is that I want the best of both worlds by default, but liburcu is LGPL and we don't want BIND to depend on code whose licence demands more from our users than the MPL.

So I set out to write my own safe memory reclamation support code.

Read more... )

July 2025

S M T W T F S
  1 2345
6789101112
13141516171819
20212223242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2025-07-30 02:46
Powered by Dreamwidth Studios