<p>Global variables in HPC-GAP can be accessed by all threads concurrently without explicit synchronization. Concurrent access is safe, but it is not deterministic. If multiple threads attempt to modify
<p><a id="X7D93681D7B5E8DCD" name="X7D93681D7B5E8DCD">java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
<div class="example"><pre>
<span="GAPprompt"&;/>< =GAPinput")>
<span class="GAPprompt">span="">gapgt> <span="GAPinput">x: ;;/>
<span="GAPprompt">gap></span<spanclass="GAPinput">WaitTask(RunTask() x := 2;end));</span
<span class=span="GAPprompt">gap;</span <span class"GAPinput">x;<span
1
</pre>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p>As can be seen here
<p><a java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
<h5>2.2-1 MakeThreadLocal</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ MakeThreadLocal</code>( <var <>code"MakeThreadLocal<>makes the variable describedbythestring< class="Arg"> a thread-local variable.It normally does not give itaninitialvalue; either explicitper-thread assignmentora to spanclass="">2.2-func/> <ahref.html#X8606D69B82B8AE84>span=RefLink22<span/)toadefaultis.</>
C7ED44627> ""22-2/>a> orclassfunc">BindThreadLocalConstructor (2.23/a>) to provide a default value is necessary.
<><code class"func">BindThreadLocal/> givesthe variabledescribedthe < classArg><var default<ar=Argobjvar The the variable accessed a ,it var="">obj</var asits if it 't been assigned a specific value yet
< ="" name>/a>/>
<h5>2.2-3 BindThreadLocalConstructorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<div class="func"><table class=
<p><code classndThreadLocal/code ( href="chap2_mj.tml#8F4832C7ED44627">span="RefLink">.22</></a>) gives thread-localvariable described by thestring class="">name/var constructor <var="Arg"></var> The time the thread-local is accessed inathread, it will yield <var class="Arg">func<> as value it hasn'tbeen assignedaspecific yet.
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">‣ ThreadVar</code></td><td class="tdright">( global variable )</td></tr></table></div>
<>ll thread-localvariables storedin thread-localrecordcodeclass"ThreadVar. Thus, if is a thread-local variable, using ThreadVar./>is as<codeclass"code">x</code./>
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.7Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.