[Cook] parallel confusion

Peter Miller millerp at canb.auug.org.au
Wed Jul 16 22:25:30 EST 2003


On Sat, 2003-06-21 at 04:00, Jody Hagins wrote:
> Specifically, when I write a recipe, do all local variables have to have
> thread IDs?

No.

> What is the granularity of an ET (execution thread)?

The recipe body.

> Does the entire recipe run in the same ET, or is it possible for each
> command within a recipe to be run in separate ETs?

The [thread-id] will be constant and unique for the duration of the
execution of a recipe body.

> If all variables are shared among all ETs, then is it safe to reference
> target, need, and other builtin variables, or will they take on the
> value of the most recent ET?

All global variable are shared among all ETs.

The [target] and [need] variables, et al, are not global variables; they
are implicitly thread specific, from the fact that the threads are bound
to recipe body execution.

> When I build local variables, do they all need to have thread-id
> somewhere in their name, or is this just the case for global variables?

No, local variables do not need thread-id in their name.
Yes, global variables do need thread-id in their name if you don't want
them to communicate with each other.

(You are right.  This stuff belong in the user guide; sending a patch
will make it happen faster.)

> Is there some way to declare a variable as per-thread, so it does not
> always have to be referenced as [myvar[thread-id]]?

Not at present.  Nice idea, tho.  Send me a patch.

> Does anyone have any cookbooks that run correctly and safely in parallel
> mode?

Yes, I do.  (But apply the itab patch.)


-- 
Regards
Peter Miller <millerp at canb.auug.org.au>
/\/\*        http://www.canb.auug.org.au/~millerp/

PGP public key ID: 1024D/D0EDB64D
fingerprint = AD0A C5DF C426 4F03 5D53  2BDB 18D8 A4E2 D0ED B64D
See http://www.keyserver.net or any PGP keyserver for public key.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.auug.org.au/pipermail/cook-users/attachments/20030716/01d641df/attachment.pgp>


More information about the Cook-users mailing list