<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Some lisps have an allow-schedule for
processes, such as (mp::process-allow-schedule).<br>
Basically, this function allows processes other than the running
(and hence
calling) process to run. All other processes of equal or higher
priority to the calling process will have a chance to run before
the
calling process is next run. This function is useful when a
process
seems to be using all available resources.
<br>
<br>
I couldn't find anything like that in the threads package unless
it had to do with mutex...<br>
<br>
Is there an equivalent function in abcl?<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>