[torquedev] keeping struct tree

Steve Snelgrove ssnelgrove at clusterresources.com
Wed May 7 15:48:45 MDT 2008


Just about as simple as a linked list is an array of pointers to linked 
lists where you have a simple hash function to pick which one to use.  
This keeps the length of the lists under control.

Matti Bickel wrote:
> Hi folks,
>
> one thing that i'm working on currently is the port of the server
> portion of torque. The code makes use of a tree structure and associated
> functions - which take a u_long parameter which in turn is basically a
> ip adress. So now with 128 bit ipv6 adresses, this just doesn't work
> anymore. It is simply impossible to compare two struct sockaddr_storage
> (which is what i switched to) the way you can compare two u_long, b/c
> there's only equality, there's no order defined on structures.
>
> Given the keys that i now work with, i switched the basic structure
> around to use struct sockaddr_storage sometime ago. The functions are
> very simple and use the compare_ip function, that i wrote for Libnet.
>
> My question now is: should we keep the tree structure around at all?
> Yes, it does manage the streams structure, which doesn't rely on ip
> adresses as keys. And for that, the current code keeps all the cruft
> around. But in the interest of clarity and MUCH less defines and
> worries, i'd like to convert this over to use a linear linked list.
> Is there any foreseeable compatibility or performance problem with this?
>
> I'd value your input on this,
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> torquedev mailing list
> torquedev at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torquedev
>   



More information about the torquedev mailing list