User guide
thread.Nootherthreadinthesetcanreferencethatsymbol.Theycannotassigntoit,
norcantheyreadfromit.Theycannotrefertoitatall.
Note:thewriter-must-isolateruleonlyappliestothethreadswithinagivenset(includ-
inganychildthreadsetstheymaycreate).Itdoesnotapplybetweenthreadsetsthat
havenochanceofrunningsimultaneously.
Forthreadsdefinedinthemaincode,thewriter-must-isolateruleappliestotheglobal
symbols.Forthreadsdefinedinproceduresorkeywords,itappliestotheglobalsymbols,
localsymbols,andtheprocedure/keywordarguments.
18.3 Coding With Threads
Therearetwomainpointstocodingwiththreads.
1. You can define threads anywhere.
Youcandefinetheminthemaincode,youcandefinetheminproc'sandkey-
word's,andyes,youcandefinetheminsideotherthreads.
2. You can call proc's and keyword's from threads.
Thisiswhatreallytieseverythingtogether.Youcancallaprocfromathread,
andthatproccancreatethreads,andanyofthosethreadscancallproc's,and
anyofthoseproc'scancreatethreads,and...yougetthepicture.
So--youcandothingslikethis:
q = chol(b);
ThreadBegin;
x = q + m;
ThreadBegin;
y = x'x;
z = q'm;
ThreadEnd;
ThreadBegin;
a = b + x;
c = a + m;
18-4
GAUSSUser Guide










