I want to save a "snapshot" of the current environment so I can play with it later without consequences for messing it up. (Essentially creating a sandbox)
I know that I can save the image with (save-lisp-and-die "sbcl.core")
. I also know that I can then load the image with sbcl --core sbcl.core
.
The problem is that I have running threads that I cannot afford to stop even for a second and this command will exit sbcl
.
My question is: Can I create an image without exiting the environment? I am looking for something like (save-lisp "sbcl.core")
If there is a portable way to do that - it would be great. If not - I am interested in a solution for SBCL.
SBCL core saving gives the following function, based on SBCL manual's advice:
Unfortunately it might not work with running threads.