lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On mar, 2012-04-24 at 11:15 -0400, Tom Freund wrote:
> Jorge, like your proposal. But,
> 
> 
> 1 - Describe "as needed" when swapping to disk, and

The objective is to allow using your table as you always did, but behind
scenes the table is synched to a disk image somewhere. And no, i don't
know how to do it :)

> 
> 
> 2 -  I am assuming that local tables are not swapped. Correct ?

Anything that is referenced in the the global "persistent" table will be
swapped.

For example:

--------
local mydata = persist['historicdata'] or {}
persist['historicdata'] = mydata

mydata[#mydata+1]=math.random()
---------

This program would add a random number to an array each time it is run.
Of course, you can nest tables to get the equivalent of a filesystem.

But his is only the first step. Then yes, you can actually swap
everything, so as to allow running tables beyond your available RAM.
Persisting then would mean keeping between restarts.


jorge