[Cook] Predefined variable [arg]

Peter Miller peterm at platypus.net
Sun Jul 20 22:42:43 EST 2003


On Fri, 2003-06-20 at 01:33, Jody Hagins wrote:
> In the User Guide, there is a caution concerning this variable, w.r.t.
> parallel execution.  I must be missing something, because it seems to
> make calling anything but the most trivial functions useless in parallel
> mode.

I can't find the warning you are referring to.  Section?

The `arg'' and ``@1'' to ``@9'' variables are implicitly local.
They are thread-safe and recursion safe.
Every function invokation receives its own set of them.
 
> In addition, I do not seem to understand when multiple threads will be
> used.  I assume that a single thread of execution will be used to build
> the entire graph

Yes, graph building is a single threaded.

Also, single thread of execution when evaluating the cookbook itself.

> then multiple threads of execution will be used to run
> the recipe bodies, if possible

Yes, graph walking can be multi threaded.

> What does this mean for late binding
> ingredients, and other uses of parallelism?

The right hand side of recipes is evaluated at graph building time (i.e.
single threaded).





More information about the Cook-users mailing list