lua-users home
lua-l archive

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


Well, Lua list, 

Who has practicaly used this method of Lua VM serialization in a shipping product and what is your experience with it (good, bad, gottchas, etc)? Do you still think this was a good decision after the fact?

Thanks,
Alex

------------------------------------------------------------------------------------------------

-----Original Message-----
From: Luiz Henrique de Figueiredo [mailto:lhf@tecgraf.puc-rio.br]
Sent: Thursday, May 06, 2004 1:49 PM
To: lua@bazar2.conectiva.com.br
Cc: leiradella@bigfoot.com; hpa@zytor.com
Subject: RE: lua state

>I need to serialize lua_state.

One simple way to do that is to use memory backed by a persistent file.

I experimented with this idea last year using GNU mmalloc:
	http://lua-users.org/lists/lua-l/2003-07/msg00251.html
but I did not find mmalloc stable. Probably just my fault.

Today I've found LPSM:
	http://freshmeat.net/projects/lpsm/
and it seems to work great! (I tested LPSM 0.1.11 on RH9 Linux.)

This scheme still does not save instruction pointers but you can stop a
Lua session and restart it later with all data intact.

For those who want to try it, get a version of lper at
	http://www.tecgraf.puc-rio.br/~lhf/tmp/lper.tar.gz

I'll do some more testing and if everything seems ok I'll make this the
official lper.

I wonder whether LPSM will run on other Unix platforms...
Also, if anyone here knows how to use GNU mmalloc well, please let me know.

Enjoy.
--lhf

------------------------------------------------------------------------------------------------

>-----Original Message-----
>From: H. Peter Anvin [mailto:hpa@zytor.com]
>Sent: Thursday, May 06, 2004 3:04 PM
>To: Bilyk, Alex
>Cc: Lua list; leiradella@bigfoot.com
>Subject: Re: lua state
>
>
>Bilyk, Alex wrote:
>>>This scheme still does not save instruction pointers but you 
>can stop a
>>>Lua session and restart it later with all data intact.
>> 
>> 
>> You are not talking about Lua VM instruction pointer, are 
>you? That is, if one had saved in the suggested fashion Lua VM 
>with a few yielded states in it, it would be possible to 
>resume them after loading that VM back, would it not?
>> 
>> On a side note, this method of serialization would produce 
>platform dependent files... right?.
>> 
>
>LPSM does indeed produce platform-dependent files.  It's intended as a 
>low overhead persistent memory manager and doesn't attempt to 
>handle the 
>memory as anything other than a heap of bytes.
>
>	-hpa
>
>