<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">Alessio,<br>
Great. Thread-yield is in that library. Thanks.<br>
Pete<br>
</div>
<blockquote
cite="mid:CAL2Kp+gSjKH=WhNiaudrG=_K+Ex8FBePd8_Hq+cxeZGWRqPNtA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, May 29, 2014 at 9:49 PM,
bonasso <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:bonasso@traclabs.com" target="_blank">bonasso@traclabs.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> <br>
<div>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>
</div>
</blockquote>
<div><br>
This is called yield in Java land. That might ring a bell
to you.<br>
<br>
</div>
<div>BTW unless you're using implementation-specific
features, it probably makes sense to use the
bordeaux-threads portability library to have the same
threading API on all major Lisps.<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div> </div>
<blockquote type="cite">
<pre>bonasso <a moz-do-not-send="true" href="mailto:bonasso@traclabs.com" target="_blank"><bonasso@traclabs.com></a> writes:
</pre>
<blockquote type="cite">
<pre>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>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>
</div>
<br>
_______________________________________________<br>
Armedbear-devel mailing list<br>
<a moz-do-not-send="true"
href="mailto:Armedbear-devel@common-lisp.net">Armedbear-devel@common-lisp.net</a><br>
<a moz-do-not-send="true"
href="http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel"
target="_blank">http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel</a><br>
<br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<br>
</body>
</html>