- All Implemented Interfaces:
- Serializable
- Enclosing class:
- StringTrie_2<E>
protected class StringTrie_2.Edge
extends Object
implements Serializable
Our Edge class is one node in the Trie graph.
It is mutable so we can keep our memory impact light,
and volatile so we can stay threadsafe.
All of this is at relatively no extra cost to processing time,
except for synchronization time on acquiring downward locks during puts
(and a little extra processing time for deletes to acquire locks as well).
Gwt doesn't pay for synchronization, so it performs optimally in js.
Note that it does not hold a parent lock while taking a child lock,
so multiple threads can still quickly transverse any potential hotspots,
where there is alot of prefix-overlap in strings, such as java packages:
com.foo.client.Something
com.foo.client.SomethingElse
com.foo.server.Something
com.bar.client.Something
com.bar.server.Something
...etc.
The fragment com. would be locked and released before acquiring foo. | bar.
This prevents concurrent modifications in different areas of the trie
to avoid blocking each other.
- Author:
- "James X. Nelson (james@wetheinter.net)"
- See Also:
- Serialized Form