From: Alex Mizrahi <killerstorm@ne...> - 2007-07-05 14:51:44
i've looked through discussion "Dump an ABCL image?", but as i understand
nobody came to a practical solution, since Java does not support "dumping
i thought so (although i didn't try to find some magic util) until i've
discovered Terracotta -- "Open Source Clustering For Java". this thing
bruttally instruments (i suspect via some Aspect-Oriented framework) Java
classes, so they become distributed -- changes to these classes propagate to
the Terracotta server, and then to other clients, so it's possible to have
objects shared between different instances.
while it's terribly cool of itself, but other feature is interesting in our
case -- Terracotta server can work in persistent mode, keeping it's data on
disk, in BDB.
so, it's possible to have kinda persistent ABCL image with this stuff.
but that's quite tricky, actually. certainly, it won't like if stuff like
Streams will be shared, that would require manual processing. also, it
requires that changes to shared state happen only in locked areas.
sharing whole Lisp interpreter lead to miserable failure, of course.
sharing PACKAGE_CL_USER was more successful, although i had to tell it not
to share useList to avoid falling back to sharing whole system.
so, now i can
(defparameter *somestuff* 47)
then launch lisp again, and *somestuff* will still be 47.
it should work for arbitrarily complex Lisp and Java structures, unless they
reference something banned.
actual state is preserved by Terracotta server. if it operates in persistent
mode, i can kill it, reboot computer (theoretically), then start server, a
new lisp instances -- and my objects are still there. i think that's great
there are more features in Terracotta -- it should be possible to share
state between different lisp environments on different machines over
network. but unfortunatelly it appears i've messed something with locks
(making them too global, i think), so second interpreter hangs until first
is taken down. i think it's possible to fix that (locking in Lisp.eval,
maybe), but i think it's cool even with persistence.
also i think it's possible to move persistent state between Terracotta
servers. BDB file it made was quite small -- 45 kb, i think it grows
proportional to data being saved.
Get latest updates about Open Source Projects, Conferences and News.