Lisp HUG Maillist Archive

Multiprocessing in LispWorks

I know about LispWorks capability for light-weight thread-based symmetric multiprocessing, but was wondering whether there is also a capability for heavier-weight multiprocessing (where global variables are distinct in each process).  When running extensive experiments over multiple variations of the same program, it would be useful to be able to run these simultaneously in separate cores without them interfering with each other. — Paul R.


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Re: Multiprocessing in LispWorks

>>>>> On Thu, 3 Apr 2014 12:07:29 -0700, Paul Rosenbloom said:
> 
> I know about LispWorks capability for light-weight thread-based symmetric
> multiprocessing, but was wondering whether there is also a capability for
> heavier-weight multiprocessing (where global variables are distinct in each
> process).  When running extensive experiments over multiple variations of
> the same program, it would be useful to be able to run these simultaneously
> in separate cores without them interfering with each other. — Paul R.

You can achieve that by binding the "global" variables to a different value in
each thread.

For example, rather than having a single global value like

(defvar *my-results* (make-hash-table))

you can use

(defvar *my-results*)

and then wrap

(let ((*my-results* (make-hash-table)))
  ...)

around the function that you want to run in a separate thread.

See also http://www.lispworks.com/documentation/lw61/LW/html/lw-122.htm

-- 
Martin Simmons
LispWorks Ltd
http://www.lispworks.com/

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


Updated at: 2020-12-10 08:34 UTC