Patch : thread safe/non-safe avl_tree implementation
Original Reporter info from Mantis: inoussa @inoussa12
-
Reporter name: Inoussa OUEDRAOGO
Original Reporter info from Mantis: inoussa @inoussa12
- Reporter name: Inoussa OUEDRAOGO
Description:
TAVLTree implementation as it is currently is not thread safe because of
TAVLTreeNodeMemManager.
This patch introduces a base avl class TBaseAVLTree that defines two abstract virtual
methods "NewNode()" and "FreeNode()" and then defines :
- TAVLTree : that _do not_ use a node mem manager, then thread safe.
- TAVLManagedTree that uses a node mem manager provided in the constructor.
The developer using this one is _aware_ of the thread safety issue and can
then provide a thread safe node mem manager for an instance exposed
to more than one thread while using the default not thread safe node
mem manager for a thread local instance.
As the DOM implementation uses the TAVLTree ( in TDOMNode_WithChildren ), it is
then affected by the thread safety issue
Additional information:
References to some discussions on the devel list:
<a href="http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg11608.html">link 1</a>
"http://www.mail-archive.com/fpc-devel@lists.freepascal.org/msg11644.html"
Mantis conversion info:
- Mantis ID: 12984
- Version: 2.3.1
- Fixed in version: 2.4.0
- Monitored by: » crossbuilder (Burkhard Carstens), » @marcoonthegit (Marco van de Voort)