Liking cljdoc? Tell your friends :D

hitchhiker.tree.bootstrap.redis

Description of refcounting system in redis

The refcounting system allows any key in redis to be managed by refcounting. This refcounter doesn't do cycle protection, but weakrefs would be very simple to add.

To have a key point to another, we call add-refs with the pointer key and list of pointee keys. Usually, the pointer key would be a struct with children.

Each key which is pointed to has an auxiliary key, which has the same name but ends in :rc. This is an int of the refcount of the key; the system deletes the key when its refcount reaches 0.

Each key which is a pointer has an auxiliary key, which has the same name but ends in :rl. This is the list of keys that we have a reference, or pointer, to. rl=reflist. This list is used when the pointer is finally deleted--every key which the pointer points to must have its refcount decremented, and if any refcount reaches 0, that key must too be deleted.

To reduce the frequency that keys are orphaned, we allow for new roots to be marked by the new-root function. This function stores the given key as a newly created root pointer, which is put onto a list with its creation time. Somehow, we track when root pointers are older than a certain time, so that we can delete them automatically.

Description of refcounting system in redis

The refcounting system allows any key in redis to be managed
by refcounting. This refcounter doesn't do cycle protection, but
weakrefs would be very simple to add.

To have a key point to another, we call add-refs with the pointer key
and list of pointee keys. Usually, the pointer key would be a struct
with children.

Each key which is pointed to has an auxiliary key, which has the same name
but ends in :rc. This is an int of the refcount of the key; the system
deletes the key when its refcount reaches 0.

Each key which is a pointer has an auxiliary key, which has the same name
but ends in :rl. This is the list of keys that we have a reference, or pointer, to.
rl=reflist. This list is used when the pointer is finally deleted--every
key which the pointer points to must have its refcount decremented, and if
any refcount reaches 0, that key must too be deleted.

To reduce the frequency that keys are orphaned, we allow for new roots to
be marked by the new-root function. This function stores the given key as a
newly created root pointer, which is put onto a list with its creation time.
Somehow, we track when root pointers are older than a certain time, so that
we can delete them automatically.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close