Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>That code is highly incomplete. At least two important parts are missing: 1) Test hand (test hand) 2) Hot / cold page reatio adaptivity</p> <p>I have to say that the original paper on this subject really lacks many important details. </p> <p>I'm currently writing Python implementation, but I haven't yet released the source because quality isn't high enough yet. </p> <p>Project URL: <a href="https://bitbucket.org/samilehtinen/pyclockpro" rel="nofollow">https://bitbucket.org/samilehtinen/pyclockpro</a></p> <p>Even when code is released, I'm quite sure there are minor but important details, which might require fine tuning.</p> <p>Like: 1) Memory hot / cold page allocation ratio upon init, I have configured so that 100% of memory is assigned for cold pages. 2) What if hot allocation gets tuned so low that hot hand should pass cold hand. I assume in this situation hot allocation is simply ignored, because hot hand going past cold hand would break everything. In this situation hand hot also clears up all non-resident test pages.</p> <p>Based on test data, my implementation seems to get tuned quite well.</p> <p>Answers to your questions: Test period is when key is kept but value is discarded. On clock face you'll see these entries between cold and test. I used int for page type, 0 non-resident cold page (test page), 1 for cold pages and 2 for hot pages. If you're using pointers to data, if pointer is Null then page is non-resident page, because you only have key without data (value).</p> <p>Yes, both and all hands can point to one block at times. Main question was, can hands go past each other. I have figured that if it happens things will get broken. So basically hot hand can push test-hand and it can push cold hand. Depending how you implement things. Or if you do it like in the paper, hand hot can go past test hand, but in that situation it drags test hand with it. And as far as I know, hand hot cant go past cold hand, or if you implement it so, then it does the work of cold hand but still drags cold hand with hot hand. </p> <p>It's hard to make simple example, because this is not simple. There are also some edge cases which require handling, at least the situations mentioned here. Also adaptivity adds edge cases, because during iterative processing memory allocation can change. Maintaining 100% allocation in these situaons require some addional checks. If you allows +/- few blocks in cache size, then implementation is simpler. </p> <p>Update, Python source and documentation is now released. So there's fully working sample to take a look at in Python.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload