Mike Lambert wrote (via RT) > Below code implements REPLENISH_LEVEL_FACTOR, which is a percentage fro 0 > to 1 which indicates at what point it will allocate more headers. Also > gives us a speedup of roughly 1.5% :)
Thanks for the patch, it certainly simplifies things. I went around in several circles playing with different algorithms, then found a bug elsewhere in my code that meant the replenishment logic wasn't working properly anyway, so I fixed that and just left the replenishment stuff as it ended up. However, your logic requires that you back-calculate the total pool size - I think we might as well just add that to the Resource_Pool struct, as it sounds like a useful number to know. Then replenish_level can be scrapped and just calculated when required. Perhaps the factor could then be made per-pool also, in case we want to be able to tune it for different resource types - what do you think? -- Peter Gibbs EmKel Systems