From: Pascal Costanza on
On 10/08/2010 13:09, Pascal Costanza wrote:
> On 08/08/2010 05:37, D Herring wrote:
>> Maybe Pascal has a good reference.
>
> Unfortunately not.


....however, the LispWorks 6.0 documentation provides some hints, with
some examples here and there. It's a bit dense, though.

See especially
http://www.lispworks.com/documentation/lw60/RNIG/html/readme-292.htm and
http://www.lispworks.com/documentation/lw60/LW/html/lw-228.htm


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
From: Pascal J. Bourguignon on
Tamas K Papp <tkpapp(a)gmail.com> writes:
> I am running Monte Carlo calculations which are inherently
> parallelizable. I would like to run multiple threads to speed things
> up, but I have no experience with threads.
>
> A mock-up of the sequential version looks like this:
>
> (defun run-chains (n)
> (let ((result (make-array n)))
> (dotimes (i n result)
> (setf (aref result i) (chain-generator)))))
>
> For the parallel version, I would like to
>
> 1) start CHAIN-GENERATOR's in separate threads for each index,
> 2) have the result of each end up in the appropriate place in the vector, and
> 3) have RUN-CHAINS wait for each of the threads to terminate before returning.
>
> I would prefer to use bordeaux-threads if possible, in order to make
> my code portable. I have figured out how to do 1-2 with MAKE-THREAD
> and closures, but I don't know how to deal with 3. I am assuming that
> I need to use locks/mutexes, but I am not familiar with these
> concepts. Hints or example code would be appreciated.

You can read any of the literature about unix threads (written for C).
google for: POSIX threads

--
__Pascal Bourguignon__ http://www.informatimago.com/