A quick overview of the cache design:
The fundamental structure is a red-black binary tree (using the glibc
implementation).
The key is a combination of the serial number, an pointer to some internal
address (for uniqueness) and an extension number
Also stored is the expiration time, the data size, and the data (a
property value, a directory listing, a bus number, etc...)
Actually there are three separate trees. one for permanent storage, one for
active items for new storage, and one for older items closer to expiration.
The latter 2 trees flip flop -- the oldest completely deleted when the no
possible current items could be present (to ensure no memory leak).
There are 3 classes of cache functions: Add (to add a new value or update an
existing value), Get to retrieve a valid cached item, and Del to forcibly
expire an entry.
The types of things cached include property values (e.g. temperature),
device presence (which bus a device exists on), directory lists, and some
internal values like temperature resolution, simultaneous conversion time,
etc...
Paul Alfille
On Mon, May 18, 2009 at 4:34 PM, Jan Kandziora <[email protected]> wrote:
> If I can do some more quick tests, feel free to send code snippets to me, I
> will patch them into my CVS image. I just feel a little awkward when I try
> to
> understand the whole caching code, it's very hard to get through it.
>
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers