[Cook] Predefined variable [arg]

Jody Hagins jody at atdesk.com
Sat Jun 21 04:17:04 EST 2003


On Fri, 20 Jun 2003 00:44:31 -0400 (EDT)
"Aryeh M. Friedman" <aryeh at m-net.arbornet.org> wrote:

> If I read the ug right a function is always run single threaded.  More
> specifically if you use a function and/or a loop (or the nesting or
> the two) to create the recipe definition(or any part except the body)
> it is run signle threaded.


What about calling a function inside the body of a recipe?  Also, what
is the long explanation of the following (taken from page 71 of the UG
9. Predefined Variables)...

"9.1 arg
This is the arguments list for user-defined functions.  Individual
arguments are split out into "@1" to "@9".  These can also be used
at[sic] automatic variables.  Caution: arg and the automatic variables
are shared for parallel execution, causing weird interactions if you
execute a command within the function."

Now, I guess this brings up the issue of what is "parallelized?"  Can
each command be given to a different thread of execution?  The above
seems to suggest that a function can call a command, and that command
may be run in a different execution thread than the function.  My
impression of parallel is that each recipe will run in an ET, so that
the same recipe may run many times but each command in that recipe will
be executed in sequence inside the same ET.

Somewhere, I am missing a major concept in how cooking in parallel
really works.



-- 
Jody Hagins

"Marriage is like a cage; one sees the birds outside desperate to get
in, and 
those inside desperate to get out."
-- Montaigne



More information about the Cook-users mailing list