Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/ferret/YAPB /tests/   (GAP Algebra Version 4.15.1©)  Datei vom mit Größe 0 B image not shown  

SSL chap1.html   Interaktion und
PortierbarkeitHTML

 

 products/Sources/formale Sprachen/GAP/doc/hpc/chap1.html


?".0"encodingUTF-8">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>GAP (hpc) - Chapter 1: Tasks</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="GAPDoc2HTML" />
<link rel="stylesheet" type="text/css" href="manual.css" />
<script src="manual.js" type="text/javascript"></script>
<script type="text/javascript">overwriteStyle();</script>
</head>
<body class="chap1"  onload="jscontent()">


<div class="chlinktopjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<div class="hlinkprevnexttop">nbsp< hrefchap0.>Top ]/>nbsp  a href"h#contents">[Contents]</a>    <a href="chap0.html">[Previous Chapter]</a>    <a href="chap2.html">[Next Chapter]</a>   </div>

<pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p><a id="X7EA285468533E153
<div class< ="func"><""width"%"<>tdclass=tdleft>codeclass""&#8227; RunAsyncTask</code>( <var class="Arg">func</var>[, <var class="Arg">arg1</var>, <var class="Arg">...</var>, <var class="Arg">argn</var>] )</td><td class="tdright">( function )</td></tr></table></div>
div class=ContSect>span java.lang.StringIndexOutOfBoundsException: Range [161, 162) out of bounds for length 161
<p< id=X7EAC7A4B86F5F74Cname"">/>/>
</div>
<div
</span>
<div <h5125ScheduleAsyncTask/java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
< =ContSS"<br >span ">nbsp&<>ahref=chap1html#X7DEC1649841E3813">1.2-1 RunTask</a></span>
<span class="<p><code class="fun"ScheduleAsyncTask<code anasynchronoustask.Itworks  code ="">cheduleTask/>(ahref"hap1.tml#X7A86AE967D2A9E94"><span class="RefLink">1.2-2</span></a>), except that its result will be ignored.</p>
<span<p><a id="X791CA0E07B16E7F9" name="X791CA0E07B16E7F9"></a></p>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X856288C27C62B14A">1.2-4 RunAsyncTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7EAC7A4B86F5F74C">1.2-5 ScheduleAsyncTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X791CA0E07B16E7F9">1.2-6 MakeTaskAsync</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X84AFD0FA7A4E3633">1.2-7 ImmediateTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X83D2E32C8759FB37">1.2-8 ExecuteTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X861BC1488345C424">1.2-9 WaitTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X81489CD684EA11B6">1.2-10 WaitAnyTask</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7A86C732823E04B6">1.2-11 TaskResult</a></span>
<span class=
</div></div>
<iv ="ContSect"<span class""<class="&;<span>< =chap1.html#X86F8419B7968345B">1.3 <span class="Heading">Information about tasks</span></a>
</span>
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span class="ContSS"><br /><span class="nocss">&;&bsp<span>a"chap1.#X87BB5EF38415B923">1.3-1 TaskSuccess</a></span>
<span class="<><code ""</code>turns   task into an asynchronoustask that cannot be  for and  result  java.lang.StringIndexOutOfBoundsException: Range [145, 144) out of bounds for length 157
"> nbsp;/>a =chap1.tml#X7C0C66E37DB9ACC0">1.3-3 CurrentTask</a></span>
<span class="ContSSjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
< =ContSS> /<panclass=nocss>nbsp&;/pan>a href="chap1.html#X7A023A657BB4F17D">1.3-5 TaskStarted</a></span>
<span class="ContSS"><br /><span class="nocss">  </span><a href="chap1.html#X7E7500E17EC1067D">1.3-6 TaskFinished</a></span>
<span
</div></< class"func"< "" width="100%>tr>td "">code ""#8227 <code(< class"">func<var>,varclass=Arg"arg1/,< =""../, <class""argn<var])/>tdclass=tdright>&function)/>/<table<>
<div class="ContSect"><span class="tocline"><span class"nocss"&;/>a="hap1.#X7B286945821A3BBA">1.4 <span class="Heading">Cancelling tasks</span></a>
</span>
<>aid"" name="<a<pjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
<span class="java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
< class=""< /< classn"n;nbsp;/>< =chap1.#X8431B91487A8A3F1">1.4-2 TaskCancellationRequested</a></span>
<span class="ContSS"><p>code class="ExecuteTask/ < "></ar  it isnot     aneffect ifits  atask returnedby<ode class""DelayTask/>(a href=.tml#X85BC2BBC7EF5B22E"><span class="RefLink">1.2-3</span></a>); otherwise, it is a no-op.</p>
<<p><a="name""<a>/>
</div></div>
<div class="ContSect"><span class="tocline"><span="< ""&8227; WaitTask</code>( <var class="Arg">task1</var>, <var class="Arg">...</var>, <var class="Arg">taskn</var> )</td><td class="tdright">( function )</td></tr></table></div>
</span>
</div>
<div class< =func"< class=func"width"%>tr<d =t"< class""&8227; varclass=""condition<var>)/d>td class=""(nbspfunction;/<java.lang.StringIndexOutOfBoundsException: Range [209, 208) out of bounds for length 223
</span>
<div <>code=func></>   < =Arg><var through <var class="rg"t<>have   ,itreturns.Alternatively conditioncanbepassedto<ode class="WaitTask/>in  to wait    is . Seeonhowtoconstruct .< class=func"WaitTaskscode  an aliasforc class="WaitTask<code></>
<span <p><a id="X"name=X81489CD684EA11B6>/a>/>
<span class="ContSS"><br /><span class="nocss">  </span><a hrefjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span < class=func"<class"unc ="100">< =tdleft>code=func>#; <code> < class""task1<,< =>.<var> var =Arg>/><td< ""(;unctionn;<td><>/>/>
<span class="ContSS"><br /><span class="nocss"> &<p>The <code class="func">WaitAnyTask</code> function waits   tofinish,  returns number  that ./>
</div></div>
<

<h3>1 <<div class=example>pre>

<p><a id="X8389AD927B74BA4A" name="<panclass=GAPprompt">g;/ span ""task1: (-Sx,[,,];<spanjava.lang.StringIndexOutOfBoundsException: Index 119 out of bounds for length 119

<h4>1.1 <span class="Heading">Overview</span></h4>

<p>Tasks provide mid- java.lang.StringIndexOutOfBoundsException: Range [86, 1) out of bounds for length 86

<p>Here is a simple example of sorting a list in the background:</p>


div class""<>
<span class="GAPprompt">gap></span> <span class<pan class=""&t<span><class=GAPinput"   ;/>
<span class="GAPpromptjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 11
<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
[ 1 2 3 java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
</<div>

<h>.- </h5>

 class=">code (< ="hap1.#X7A86C732823E04B6"><span class="RefLink">1.2-11</span></a>) does an implicit <code class="func">WaitTask</code> (<a href="chap1.html#X861BC1488345C424"><span class="RefLink">1.2-9</span></a>), so the second line above can actually be omitted:</p>


<div class="example"><pre>
<span class="GAPprompt">java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
spanclass"GAPprompt>&t;/><pan class=GAPinput"TaskResulttask;/java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
[ < id"X830A82A7847993FF =X830A82A7847993FF>/><>
</pre></div>

<p>It is java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0


<div class="java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
span class=GAPprompt>&t<span>< class""task1: Product, 1.000];
<span class="java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 0
<java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
true
</pre>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<p>You can use <code class=""DelayTask/>(a "html#X85BC2BBC7EF5B22E"><span class="RefLink">1.2-3</span></a>) to delay executing the task until its result is actually needed.</p>


<div class="example"><pre>
span "">gap&t;<span>class""task1 =DelayTask, [1..5000]);;</span>
<pan class=GAPprompt"&t;</pan><span class=GAPinput">: DelayTaskProduct 5001.10000];<>
<span class="GAPprompt">gap></span> <span class="GAPinput">WaitTask(task1, task2);</span>
spanclass=GAPprompt>><span>s class""TaskResulttask1) ()=Factorial10000;/>
true
</<h5>133CurrentTask/>

<pdivclass="func">tableclass=func width=100%>tr< class=tdleft> class"unc">&#8227; CurrentTask</code>(  )</td><td class="tdright">( function )</td></tr></table></div>

<<pThe<class="unc">urrentTask/ thecurrentlyrunningtask<pjava.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84

<


<div class="example"><pre>
<span class="GAPprompt">gap><java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
n class=GAPinput>(ask;/>
[ 1, 2, 3 ]
</pre></div>

<p>This <>hisfunction thenumber ofcurrently running  Note    onlyan approximation andcanchangeasnew  arebeingstartedby  ./>

pIf e.. you   call a   for -,it canbeusefulto the  of  task.< class=func"RunAsyncTask</code> (a ".html#X856288C27C62B14A"><span class="RefLink">1.2-4</span></a>) provides the necessary functionality. Such a task cannot be waited for and its result (if any) is ignored.</p>


<div class="example"><pre>
<span class="GAPprompt"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
span ""&t<span span class""!/spanjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
-   []
--- Thread 5 [5] (pending output)
<span class="GAPprompt"<>aid="X7E7500E17EC1067D X7E7500E17EC1067D></></>
--- Switching h5>1.3-6 TaskFinished>
[5] Hello, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
!
--- Switching to thread 0
ap&t;
</pre></div>

<p>For more information java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<p>Taskjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<p>HPC-GAPjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<p><a id="X7C9F2EF384645B8F" name="X7C9F2EF384645B8F"></a></p>

<h4>1.2 <span class="Heading">Running tasks</span></h4>

<p>java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<h5>1.2-1 RunTaskjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<div class="func"><table class="func" width="java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p><code classjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<p><a id="X7A86AE967D2A9E94

<5122ScheduleTask/java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27

<div class="funcjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
> ataskexecution, ,unlike<odeclass""RunTask<code < href".html#X7DEC1649841E3813"><span class="RefLink">1.2-1</span></a>) does not start it until <var class="Arg">condition</var> is met. See on how to construct conditions. Simple examples of conditions are individual tasks, where execution occurs after the task completes, or lists of tasks, where execution occurs after all tasks in the list complete.</p>


<div <div class</h5java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
prompt"gap&t<span span "> : RunTask(->xx 3;<span>
<<p> class="func"TaskCancellationRequestedcode true <ode =func"<code>(ahref=chap1.#X86C26E3081C3C9AA"><span class="RefLink">1.4-1</span></a>) has been called for <var class="Arg">task</var>, false otherwise.</p>
<java.lang.StringIndexOutOfBoundsException: Range [0, 5) out of bounds for length 0
">          return (t1) + ()/span>
<span class="
<<>43OnTaskCancellation>
25
</pre></div><div =f"< =func"width"00"<><td =tdleft>code=""&8227;OnTaskCancellation/> vclass=Arg><var> <td>td class="(nbspf )/><tr>/<div>

pWhilethe aboveexample also  achieved with< class""RunTask < href".#X7DEC1649841E3813"<span=RefLink>12-</pan</a)inlieuof codeclass"func>ScheduleTask<code> since <odeclass"func"TaskResult/> <ahref"chap1.html#X7A86C732823E04B6"><span class="RefLink">1.2-11</span></a>) would wait for <var class="Arg">t1</var> and <var class="Arg">t2</var> to complete, the above implementation does not actually start the final task until the others are complete, making it more efficient, since no additional worker thread needs to be occupied.</p>

<p><a id="X85BC2BBC7EF5B22E" name=< =GAPprompt>gt<span> <pan =GAPinput"     truedo<>

<h5>1.2-3 DelayTask</h5>

<div class<pan "GAPprompt">/ <spanclass="java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 74
<p><code <spanclass""gap<>span class=GAPinput"CancelTaskt)<span>

<p><a id="X856288C27C62B14A" name="span class="GAPprompt">gap></span> <span"APinput>(task);<

<<pre<divjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12

<div class="func"><table class="func" width="100%java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<java.lang.StringIndexOutOfBoundsException: Range [0, 2) out of bounds for length 0

<p><a id="X7EAC7A4B86F5F74C" name="X7EAC7A4B86F5F74C"></a></p>

<h5>1.2-5 ScheduleAsyncTask</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; ScheduleAsyncTask</code>( <var class="Arg">condition</var>, <var class="Arg">func</var>[, <var class="Arg">arg1</var>, <var class="Arg">...</var>, <var class="Arg">argn</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">ScheduleAsyncTask</code> creates an asynchronous task. It works like <code class="func">ScheduleTask</code> (<a href="chap1.html#X7A86AE967D2A9E94"><span class="RefLink">1.2-2</span></a>), except that its result will be ignored.</p>

<p><a id="X791CA0E07B16E7F9" name="X791CA0E07B16E7F9"></a></p>

<h5>1.2-6 MakeTaskAsync</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; MakeTaskAsync</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">MakeTaskAsync</code> turns a synchronous task into an asynchronous task that cannot be waited for and whose result will be ignored.</p>

<p><a id="X84AFD0FA7A4E3633" name="X84AFD0FA7A4E3633"></a></p>

<h5>1.2-7 ImmediateTask</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; ImmediateTask</code>( <var class="Arg">func</var>[, <var class="Arg">arg1</var>, <var class="Arg">...</var>, <var class="Arg">argn</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">ImmediateTask</code> executes the task specified by its arguments synchronously, usually within the current thread.</p>

<p><a id="X83D2E32C8759FB37" name="X83D2E32C8759FB37"></a></p>

<h5>1.2-8 ExecuteTask</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; ExecuteTask</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">ExecuteTask</code> starts <var class="Arg">task</var> if it is not already running. It has only an effect if its argument is a task returned by <code class="func">DelayTask</code> (<a href="chap1.html#X85BC2BBC7EF5B22E"><span class="RefLink">1.2-3</span></a>); otherwise, it is a no-op.</p>

<p><a id="X861BC1488345C424" name="X861BC1488345C424"></a></p>

<h5>1.2-9 WaitTask</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; WaitTask</code>( <var class="Arg">task1</var>, <var class="Arg">...</var>, <var class="Arg">taskn</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; WaitTask</code>( <var class="Arg">condition</var> )</td><td class="tdright">( function )</td></tr></table></div>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; WaitTasks</code>( <var class="Arg">task1</var>, <var class="Arg">...</var>, <var class="Arg">taskn</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">WaitTask</java.lang.StringIndexOutOfBoundsException: Range [73, 35) out of bounds for length 73

<p><a id="X81489CD684EA11B6" name="java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0

<h5>1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

<<p java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 112
p <ode "func"WaitAnyTask<code>functionwaits any f arguments tof,then returnsthe  hat ask..<p>


<div class="example"><body>
<span class="GAPprompt">gap><html>
<span class="GAPprompt">gap></span> <span class="GAPinput">task2 := DelayTask(x->SortedList(x), [6,5,4]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">which := WaitAnyTask(task1, task2);</span>
2
<span class="GAPprompt">gap></span> <span class="GAPinput">if which = 1 then</span>
<span class="GAPprompt">></span> <span class="GAPinput">     Display(TaskResult(task1));Display(TaskResult(task2));</span>
<span class="GAPprompt">></span> <span class="GAPinput">   else</span>
<span class="GAPprompt">></span> <span class="GAPinput">     Display(TaskResult(task2));Display(TaskResult(task1));</span>
<span class="GAPprompt">></span> <span class="GAPinput">   fi;</span>
[ 4, 5, 6 ]
[ 1, 2, 3 ]
</pre></div>

<p>One can pass a list of tasks to <code class="code">WaitAnyTask</code> as an argument; <code class="code">WaitAnyTask([task1, ..., taskn])</code> behaves identically to <code class="code">WaitAnyTask(task1, ..., taskn)</code>.</p>

<p><a id="X7A86C732823E04B6" name="X7A86C732823E04B6"></a></p>

<h5>1.2-11 TaskResult</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; TaskResult</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The <code class="func">TaskResult</code> function returns the result of a task. It implicitly calls <code class="func">WaitTask</code> (<a href="chap1.html#X861BC1488345C424"><span class="RefLink">1.2-9</span></a>) if that is necessary. Multiple invocations of <code class="func">TaskResult</code> with the same task argument will not do repeated waits and always return the same value.</p>

<p>If the function executed by <var class="Arg">task</var> encounters an error, <code class="func">TaskResult</code> returns <code class="keyw">fail</code>. Whether <var class="Arg">task</var> encountered an error can be checked via <code class="func">TaskSuccess</code> (<a href="chap1.html#X87BB5EF38415B923"><span class="RefLink">1.3-1</span></a>). In case of an error, the error message can be retrieved via <code class="func">TaskError</code> (<a href="chap1.html#X85F42F5E7E04F3C2"><span class="RefLink">1.3-2</span></a>).</p>

<p><a id="X830A82A7847993FF" name="X830A82A7847993FF"></a></p>

<h5>1.2-12 CullIdleTasks</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; CullIdleTasks</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function terminates unused worker threads.</p>

<p><a id="X86F8419B7968345B" name="X86F8419B7968345B"></a></p>

<h4>1.3 <span class="Heading">Information about tasks</span></h4>

<p><a id="X87BB5EF38415B923" name="X87BB5EF38415B923"></a></p>

<h5>1.3-1 TaskSuccess</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; TaskSuccess</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">TaskSuccess</code> waits for <var class="Arg">task</var> and returns <code class="keyw">true</code> if the it finished without encountering an error. Otherwise the function returns <code class="keyw">false</code>.</p>

<p><a id="X85F42F5E7E04F3C2" name="X85F42F5E7E04F3C2"></a></p>

<h5>1.3-2 TaskError</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; TaskError</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">TaskError</code> waits for <var class="Arg">task</var> and returns its error message, if it encountered an error. If it did not encounter an error, the function returns <code class="keyw">fail</code>.</p>

<p><a id="X7C0C66E37DB9ACC0" name="X7C0C66E37DB9ACC0"></a></p>

<h5>1.3-3 CurrentTask</h5>

<div class="func"><table class="func" width="100%"><tr><td class="p>
<p>The <code class="func">CurrentTask</code> returns the currently running task.</p>

<p><a id="X7DA4E06B792002C7" name="X7DA4E06B792002C7"></a></p>

<h5>1.3-4 RunningTasks</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; RunningTasks</code>(  )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function returns the number of currently running tasks. Note that it is only an approximation and can change as new tasks are being started by other threads.</p>

<p><a id="X7A023A657BB4F17D" name="X7A023A657BB4F17D"></a></p>

<h5>1.3-5 TaskStarted</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; TaskStarted</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function returns true if the task has started executing (i.e., for any non-delayed task), false otherwise.</p>

<p><a id="X7E7500E17EC1067D" name="X7E7500E17EC1067D"></a></p>

<h5>1.3-6 TaskFinished</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; TaskFinished</code>( <var class="Arg">task</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>This function returns true if the task has finished executing and its result is available, false otherwise.</p>

<p><a id="X7B37CED386024A1F" name="X7B37CED386024A1F"></a></p>

<h5>1.3-7 TaskIsAsync</h5>

<div class="func">
<p>This function returns true if the task is asynchronous, true otherwise.</p>

<p><a id="X7B286945821A3BBA" name="X7B286945821A3BBA"></a></p>

<h4>1.4 <span class="Heading">Cancelling tasks</span></h4>

<p>HPC-GAP uses a cooperative model for task cancellation. A programmer can request the cancellation of another task, but it is up to that other task to actually terminate itself. The tasks library has functions to request cancellation, to test for the cancellation state of a task, and to perform actions in response to cancellation requests.</p>

<p><

h5141CancelTask</5java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25

div class">t=func"width=100"<>td class=>code class=func># /(v class">ask/ <t>classtjava.lang.StringIndexOutOfBoundsException: Range [173, 172) out of bounds for length 220
<<=X80CB3247854A46E4 ""<a<p

<<161<h5>

.2<h5>

<div class="func"><table class<> <ode class=func>/>function creates a new milestone. Its argument is a list java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<

java.lang.StringIndexOutOfBoundsException: Index 267 out of bounds for length 62

<h5>1.4-3 OnTaskCancellation

<div class="func">java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0


<div class="example"><pre>
<span G"gapgt<span span class=" : (function(<span>
<span class="GAPprompt">><> ""/code allows t  milestone  inglestep  addingi  it i mostusefulcwith java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
span class="GAPprompt">></span> <span class="GAPinput">       OnTaskCancellation(function() return 314; end);</span>
<span class="GAPprompt">></span> <span class="GAPinput">     od;</span>
<span class="GAPprompt">>;<span < class=GAPinput"   end;<span>
=java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 86
<span class="GAPprompt">gap><":/math.wth-achen.e~Luebeck/>/>/>
314
</pre></div>

<p><a id="java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 7

<h5>1.4-4 OnTaskCancellationReturn</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; OnTaskCancellationReturn</code>( <var class="Arg">value</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">OnTaskCancellationReturn</code> is a convenience function that does the same as: <code class="code">OnTaskCancellation(function() return value; end);</code></p>

<p><a id="X802FC4C284F68696" name="X802FC4C284F68696"></a></p>

<h4>1.5 <span class="Heading">Conditions</span></h4>

<p><code class="func">ScheduleTask</code> (<a href="chap1.html#X7A86AE967D2A9E94"><span class="RefLink">1.2-2</span></a>) and <code class="func">WaitTask</code> (<a href="chap1.html#X861BC1488345C424"><span class="RefLink">1.2-9</span></a>) can be made to wait on more complex conditions than just tasks. A condition is either a milestone, a task, or a list of milestones and tasks. <code class="func">ScheduleTask</code> (<a href="chap1.html#X7A86AE967D2A9E94"><span class="RefLink">1.2-2</span></a>) starts its task and <code class="func">WaitTask</code> (<a href="chap1.html#X861BC1488345C424"><span class="RefLink">1.2-9</span></a>) returns when the condition has been met. A condition represented by a task is met when the task has completed. A condition represented by a milestone is met when the milestone has been achieved (see below). A condition represented by a list is met when all conditions in the list have been met.</p>

<p><a id="X7EE6DC40842CD74B" name="X7EE6DC40842CD74B"></a></p>

<h4>1.6 <span class="Heading">Milestones</span></h4>

<p>Milestones are a way to represent abstract conditions to which multiple tasks can contribute.</p>

<p><a id="X80CB3247854A46E4" name="X80CB3247854A46E4"></a></p>

<h5>1.6-1 NewMilestone</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; NewMilestone</code>( [<var class="Arg">list</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p>The <code class="func">NewMilestone</code> function creates a new milestone. Its argument is a list of targets, which must be a list of integers and/or strings. If omitted, the list defaults to <code class="code">[0]</code>.</p>

<p><a id="X800AE2737CB715C5" name="X800AE2737CB715C5"></a></p>

<h5>1.6-2 ContributeToMilestone</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; ContributeToMilestone</code>( <var class="Arg">milestone</var>, <var class="Arg">target</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The <code class="func">ContributeToMilestone</code> milestone function contributes the specified target to the milestone. Once all targets have been contributed to a milestone, it has been achieved.</p>

<p><a id="X7ACB26D38096CD56" name="X7ACB26D38096CD56"></a></p>

<h5>1.6-3 AchieveMilestone</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; AchieveMilestone</code>( <var class="Arg">milestone</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>The <code class="func">AchieveMilestone</code> function allows a program to achieve a milestone in a single step without adding individual targets to it. This is most useful in conjunction with the default value for <code class="func">NewMilestone</code> (<a href="chap1.html#X80CB3247854A46E4"><span class="RefLink">1.6-1</span></a>), e.g.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">m := NewMilestone();;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">AchieveMilestone(m);</span>
</pre></div>

<p>></p>

<p><a id="X83E7AF007E040FB9" name="X83E7AF007E040FB9"></a></p>

<h5>1.6-4 IsMilestoneAchieved</h5>

<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">&an style='color:green'>#8227; IsMilestoneAchieved</code>( <var class="Arg">milestone</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="func">IsMilestoneAchieved</code> tests explicitly if a milestone has been achieved. It returns <code class="keyw">true</code> on success, <code class="keyw">false</code> otherwise.</p>


<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">m := NewMilestone([1,2]);;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">ContributeToMilestone(m, 1);</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMilestoneAchieved(m);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">ContributeToMilestone(m, 2);</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsMilestoneAchieved(m);</span>
true
</pre></div>


<div class="chlinkprevnextbot"> <a href="chap0.html">[Top of Book]</a>   <a href="chap0.html#contents">[Contents]</a>    <a href="chap0.html">[Previous Chapter]</a>    <a href="chap2.html">[Next Chapter]</a>   </div>


<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a>  <a href="chap1.html">1</a>  <a href="chap2.html">2</a>  <a href="chap3.html">3</a>  <a href="chap4.html">4</a>  <a href="chap5.html">5</a>  <a href="chap6.html">6</a>  <a href="chap7.html">7</a>  <a href="chap8.html">8</a>  <a href="chap9.html">9</a>  <a href="chap10.html">10</a>  <a href="chap11.html">11</a>  <a href="chapInd.html">Ind</a>  </div>

<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>

Messung V0.5 in Prozent
C=97 H=73 G=85

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.290Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

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 und die Messung sind noch experimentell.