Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
arf, 32bytes not 32bit! it seem to work now, good new :) I apologize 2008/8/8 Henri Gourvest <[EMAIL PROTECTED]>: > this limit depend on the max size of a "set of" data type > because I store the enumerator stack in an Integer value. > TAvlBitArray = set of 0..AVL_MAX_DEPTH - 1; > unfortunally on

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
this limit depend on the max size of a "set of" data type because I store the enumerator stack in an Integer value. TAvlBitArray = set of 0..AVL_MAX_DEPTH - 1; unfortunally on FPC 2.2.0 64: if TAvlBitArray = set of 0..63; sizeof(TAvlBitArray) is still 32 I don't know if it will be changed late

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Mattias Gaertner
On Fri, 8 Aug 2008 14:57:36 +0200 "Henri Gourvest" <[EMAIL PROTECTED]> wrote: > > Because of this: > > AVL_MAX_DEPTH = sizeof(longint) * 8; > > = 32 in all cases, I know and It is not a problem. At least not now. But eventually it should be changed to AVL_MAX_DEPTH = sizeof(PtrInt) * 8; Mattia

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
> Because of this: > AVL_MAX_DEPTH = sizeof(longint) * 8; = 32 in all cases, I know and It is not a problem. henri ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Mattias Gärtner
Zitat von Henri Gourvest <[EMAIL PROTECTED]>: > 2008/8/8 Mattias Gärtner <[EMAIL PROTECTED]>: > > Correct me if I'm wrong, but this seems not very comfortable. > > - No custom sort function (unless you override) > ... > > > - A node does not know its parent. So with First or Search you can not get

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
2008/8/8 Mattias Gärtner <[EMAIL PROTECTED]>: > Correct me if I'm wrong, but this seems not very comfortable. > - No custom sort function (unless you override) ... > - A node does not know its parent. So with First or Search you can not get to > the next node. You need always an iterator (iterator

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Mattias Gärtner
Zitat von Henri Gourvest <[EMAIL PROTECTED]>: > I made 2 AVL tree for different kind of problems > > this one is generic (32/64+all platformes) > http://uib.svn.sourceforge.net/viewvc/uib/trunk/source/uibavl.pas?view=markup > it is based on http://www.geocities.com/wkaras/gen_c/cavl_tree.html Cor

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
I just found another one, I made long time ago, I stopped to use it because it is based on libavl and licence is GPL. unit libavl; interface {$ALIGN ON} {$MINENUMSIZE 4} const MAX_STACK = 32; type TBranchDir = (bLeft, bRight); PIndexSlot = ^TIndexSlot; TIndexSlot = record FData: Poin

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Henri Gourvest
I made 2 AVL tree for different kind of problems this one is generic (32/64+all platformes) http://uib.svn.sourceforge.net/viewvc/uib/trunk/source/uibavl.pas?view=markup it is based on http://www.geocities.com/wkaras/gen_c/cavl_tree.html this one only index string and use both Hash and AVL tree f

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Mattias Gärtner
Zitat von Marc Weustink <[EMAIL PROTECTED]>: > Marco van de Voort wrote: > >> Marco van de Voort wrote: > Inoussa OUEDRAOGO wrote: > > - TAVLManagedTree that uses a node mem manager provided in the > constructor. > >The developer using this one is _aware_ of the thread safety iss

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Marc Weustink
Marco van de Voort wrote: Marco van de Voort wrote: Inoussa OUEDRAOGO wrote: - 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

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-08 Thread Marco van de Voort
> Marco van de Voort wrote: > >> Inoussa OUEDRAOGO wrote: > >>> - 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

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Micha Nelissen
Marco van de Voort wrote: Inoussa OUEDRAOGO wrote: - 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 What is exactly th

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Marco van de Voort
> Inoussa OUEDRAOGO wrote: > > - 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 > > What is exactly the add-

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Mattias Gaertner
On Thu, 07 Aug 2008 18:04:32 +0200 Micha Nelissen <[EMAIL PROTECTED]> wrote: > Inoussa OUEDRAOGO wrote: > > - 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 nod

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Inoussa OUEDRAOGO
2008/8/7 Micha Nelissen <[EMAIL PROTECTED]>: > Inoussa OUEDRAOGO wrote: >> >> - 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 in

Re: [fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Micha Nelissen
Inoussa OUEDRAOGO wrote: - 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 What is exactly the add-on value for the nod

[fpc-devel] TAVLTree(avl_tree.pp) thread safety : second proposition

2008-08-07 Thread Inoussa OUEDRAOGO
Second proposition : Another proposition is to introduce a base avl class say TBaseAVLTree that defines two abstract virtual methods "NewNode()" and "FreeNode()" and then define : - TAVLTree : that _do not_ use a node mem manager, then thread safe. - TAVLManagedTree that uses a node mem manager