Open
Description
Modifications to the trie (put and del) are protected via a semaphore. The locking period however can be quite long, as after taking the semaphore put
calls findPath
and possibly _updateNode
, both of which are IO-bound. This reduces throughput of updates significantly.
This issue aims to discuss two points:
- What are the thread-safety requirements of the trie? i.e. What are the race conditions that have to be protected against?
- Given the requirements, would it be possible to limit the use of semaphores to the absolute minimum or remove them completely to improve throughput?
Edit: Initial benchmarking results suggest this to be a bottleneck.