[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gcl-devel] Parallelism in traditional lisp syntax

From: Camm Maguire
Subject: [Gcl-devel] Parallelism in traditional lisp syntax
Date: 07 Nov 2005 15:21:24 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Sigh.  There really is no lisp construct which implies correct
parallelizability if correctly written, unlike I had previously
thought was the case with e.g. let, psetq, etc.  From the spec:

          adj. Trad. (of binding or assignment)   done in the style of
          psetq, let, or do;   that is, first evaluating all of the
          forms that produce values,   and only then assigning or
          binding the variables (or places).    Note that this does not
          imply traditional computational "parallelism"   since the
          forms that produce values are evaluated sequentially.    See

          adj. Trad. (of binding or assignment)   done in the style of
          setq, let*, or do*;   that is, interleaving the evaluation of
          the forms that produce values   with the assignments or
          bindings of the variables (or places).    See parallel.


Other references to "parallel" in the spec follow below.

I was intending to provide si::p-setq, si::p-setf, etc. but now I'm
not really sure if this makes any sense.

Take care,


   It is possible to do more than one setf in parallel via psetf,
shiftf, and rotatef.  Because of this, the

let and let* create new variable bindings and execute a series of forms
that use these bindings.  let performs the bindings in parallel and
let* does them sequentially.

[psetq]   This is just like setq, except that the assignments happen "in
parallel."  That is, first all of the forms are evaluated, and only
then are the variables set to the resulting values.  In this way, the
assignment to one variable does not affect the value computation of
another in the way that would occur with setq's sequential assignment.

   Undoing of handler and restart bindings during an exit happens in
parallel with the undoing of the bindings of dynamic variables and
catch tags, in the reverse order in which they were established.  The
effect of this is that cleanup-form sees the same handler and restart
bindings, as well as dynamic variable bindings and catch tags, as were
visible when the unwind-protect was entered.

   For prog, init-forms are evaluated first, in the order in which they
are supplied. The vars are then bound to the corresponding values in
parallel.  If no init-form is supplied for a given var, that var is
bound to nil.

   For psetf, if more than one pair is supplied then the assignments of
new values to places are done in parallel.  More precisely, all

The for and as constructs provide iteration control clauses that
establish a variable to be initialized.  for and as clauses can be
combined with the loop keyword and to get parallel initialization and
stepping_1.  Otherwise, the initialization and stepping_1 are

   The with construct is similar to a single let clause.  with clauses
can be combined using the loop keyword and to get parallel

expression is evaluated.  However, by using the loop keyword and to
join several with clauses, initializations can be forced to occur in
parallel; that is, all of the supplied forms are evaluated, and the
results are bound to the respective variables simultaneously.

do accepts an arbitrary number of iteration vars which are bound within
the iteration and stepped in parallel.  An initial value may be
   do* is exactly like do except that the bindings and steppings of the
vars are performed sequentially rather than in parallel.

condition that had been signaled.  If more than one case is provided,
those cases are made accessible in parallel.  That is, in

       (handler-case form
         (typespec1 (var1) form1)
         (typespec2 (var2) form2))

   if the first clause (containing form1) has been selected, the
handler for the second is no longer visible (or vice versa).

Camm Maguire                                            address@hidden
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]