<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Ah. Threads, not processes. Thank you!<br>
</div>
<blockquote cite="mid:87r43cgz33.fsf@sapo.pt" type="cite">
<pre wrap="">bonasso <a class="moz-txt-link-rfc2396E" href="mailto:bonasso@traclabs.com"><bonasso@traclabs.com></a> writes:
</pre>
<blockquote type="cite">
<pre wrap="">In ACL one starts a process with a function as follows:
(mp::process-run-function
'start-raps
rap::rap-state* 2 nil)
where you give process-run-function the function name and the rest are
the args to that function.
I couldn't really find how to do that in abcl. system::run-program was
the closest thing but the definition in the manual didn't seem to be
what I was looking for.
</pre>
</blockquote>
<pre wrap="">
Looking at the documentation of "process-run-function" it seems that
what you want is to run a function in a another thread and not a system
program (which is what "run-program" is for). You should look in the
manual for the THREADS package, especially the "make-thread" function.
The interface of "make-thread" is slightly different from the interface
of "process-run-function" due to the fact that "make-thread" receives a
function, but not it's arguments.
However you can work around this by providing your own wrapper function
similar to this:
(defun my-make-thread (name function &rest arguments)
(threads:make-thread (lambda ()
(apply function arguments))
:name (if (symbolp name)
(symbol-name name)
name)))
And then you can use it like this:
(setf my-thread (my-make-thread 'my-thread-name #'format nil "This is an example: ~s" 10))
(let (output)
(setf output (threads:thread-join my-thread))
output)
And output should contain the string "This is an example: 10".
</pre>
</blockquote>
<br>
</body>
</html>