How do I spawn off a background (named) sub-process/thread in ABCL? That is, I want to spawn the sub-process (or thread) to run in the background and leave the top-level evaluation free for other processing.
Using (apropos 'process/thread) I have found undocumented functions like those listed below, but I can't figure out the syntax. I am looking for the running example code to follow/modify. I seem to have created a process with the following make-process function, but I get an error when I try to kill it, and it runs in the foreground. There is no entry in the ABCL manual for make-process. MAKE-THREAD is listed, but as not-documented.
Where is the documentation / examples for all the functions listed in the ABCL manual with this "not-documented" designation? (Also those found with apropos?)
As a separate but related issue, is there a repository of ABCL-specific running code examples online that cover edge-case questions like these?
In other common-lisps I would use functions like:
(activate-process *initial-process*)
or
#+(:and MULTITASKING :lucid)
(defun mpd (&optional (reinit nil))
(user::make-process :name "Pdraw-proc" :function #'pd::pdraw :args (list reinit)))
In ABCL I have muddled around getting not far:
CL-USER> (setf uu (make-thread (my-reader))) <-- runs at the top level / hogs read loop
CL-USER> (setf jj (system::%make-process (foo)))
#S(SYSTEM:PROCESS :JPROCESS 3 :INPUT NIL :OUTPUT NIL :ERROR NIL)
CL-USER> jj
#S(SYSTEM:PROCESS :JPROCESS 3 :INPUT NIL :OUTPUT NIL :ERROR NIL)
SYSTEM::MAKE-PROCESS (fbound)
SYSTEM::%PROCESS-KILL (fbound)
SYSTEM::%MAKE-PROCESS (fbound)
and
THREADS:MAKE-THREAD (fbound)
THREADS:DESTROY-THREAD (fbound)
and
(make-two-way-stream ...)
[Syntax / examples for creating necessary streams for the threads maybe?]
Thanks in advance for pointers or code.
I use ABCL with roswell so it is easy to use in conjuntion with quicklisp, but there is also a project for that, but I think that you could easily use quicklisp or load libraries in ABCL. There are a lot of libraries that you can load on ABCL that are from quicklisp, unfortunately not all (Quicklisp is tested over linux & SBCL), but for concurrency you can load two great libraries that I normally use bordeaux-threads (the common threats library in common lisp) and Chanl a library that ports go channnels to common lisp. There are others that you could try but I'm not sure if they work lparallel, cl-actors ...
Let's do an example with this libraries:
Note that this are only example purpouses a global variable is not a good use for threats, also take a look on the libraries for further documentation,that should work, Also you in ABCL it is easy tou use java libraries, so maybe you can use akka actors, or other java concurrency libraries
Also as you poiinted ABCL has a package for threats, it is easy to use, like this:
Also it has implemented mailbox threats to pass message to the threads