Common Lisp – error saving SbCl image from Emacs multi thread

I have been saving and running the Common Lisp image to save restart time and improve development efficiency However, I encountered some problems when I ran the following command in Emacs / slim:

(sb-ext:save-lisp-and-die "rest-api-image" :purify t)

I received the following error Obviously, it complains about seeing multiple threads As far as I know, these are not threads I created programmatically Instead, these were created by LISP - and Emacs Is there a solution here? Can the image still be saved?

Cannot save core with multiple threads running.

Interactive thread (of current session):
  #<THREAD "main thread" RUNNING {1000550853}>

Other threads:
  #<THREAD "Swank Sentinel" #1=waiting on:
       #<WAITQUEUE  {1004AB8003}>
     {1004AB4753}>,#<THREAD "control-thread" #1#
       #<WAITQUEUE  {1005BC54D3}>
     {1004D87F03}>,#<THREAD "reader-thread" RUNNING {1004D88063}>,#<THREAD "swank-indentation-cache-thread" #1#
       #<WAITQUEUE  {1004D980E3}>
     {1004D88183}>,#<THREAD "auto-flush-thread" RUNNING {10022FFDA3}>,#<THREAD "repl-thread" RUNNING {1002300003}>
   [Condition of type SB-IMPL::SAVE-WITH-MULTIPLE-THREADS-ERROR]
See also:
  SBCL Manual,Saving a Core Image [:node]

Solution

The typical way to save an image is to start SbCl from the command line (not from the Emacs of slim), load the contents existing in the image, and then save the image immediately This ensures that slime or other running processes / threads do not establish any state or thread when trying to save

I usually write a short LISP file to do this, and finally call save LISP and die

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>