<p>Tasks provide mid- to high-level functionality for programmers to describe asynchronous workflows. A task is an asynchronously or synchronously executing job; functions exist to create tasks that are executed concurrently, on demand, or in the current thread; to wait for their completion, check their status, and retrieve any results.</p>
<p>Here is a simple example of sorting a list in the background:</p>
<p><code class="func">RunTask</code> (<a href="chap1.html#X7DEC1649841E3813"><span class="RefLink">1.2-1</span></a>) dispatches a task to run in the background; a task is described by a function and zero or more arguments that are passed to <code class="func">RunTask</code> (<a href="chap1.html#X7DEC1649841E3813"><span class="RefLink">1.2-1</span></a>). <code class="func">WaitTask</code> (<a href="chap1.html#X861BC1488345C424"><span class="RefLink">1.2-9</span></a>) waits for the task to complete; and <code class="code">TaskResult</code> returns the result of the task.</p>
pcodeclass""T<>(ahref".tml#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>
=GAPprompt">&;<>< class=GAPinput"f(Print",world\";end;;span>
<panclass">ap>/ span =GAPinput>!ist<spanjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
--0 [0]
--- Thread 5 [5] <panclass"ontSS"/< class">nbsp;nbsp;/< href"h
<span "">gap&t<span><span class="!</span>
- to 5
[ !
!0
--- Switching to thread 0
apgtjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
/<div>
<p>HPC-GAP currently br/<panclass=nocss"&bsp;nbsp;/>ahref=chap1.tml#X7ACB26D38096CD56">1.6-3 AchieveMilestone</a></span>
<p><a id="X7C9F2EF384645B8F<>>
<</d>
<p><a id
<121RunTask/>
<div class="func"><table
p<code class=func><code> prepares a task for starts it.Thetaskwillcall < class=A"func<var>with <class""a<varthrough var="rg>/var iprovided) returnvalueof vclass=Arg"<var>is theresult task code =f"RunTask/>call returns a objectthatcan be used by functions argument./>
p< id=X7A86AE967D2A9E94"name""<a>/>
<h5>1.2-2 ScheduleTask</h5>
<div class="func">class=GAPprompt>ap><span><span =GAPinput>aitTaskt)<span>
=""ScheduleTask<code>prepares execution ,unlike code class=func"RunTask</code> (<a href="chap1.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 class="example"><pre>
<span class="GAPprompt"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<pan class=GAPprompt"g&t<span><pan class=GAPinput"t2 :RunTask*,);/>
<span class="GAPprompt">gap></span> <span class="
<pan =GAPprompt>gt;span><spanclass=GAPinput>returnTaskResult(1) +TaskResultt)<span>
<span class<class=GAPprompt"gap&t;< span =GAPinput" : RunTaskx & x,[,,];<span>
<pan =GAPprompt>><span><spanclass=GAPinput>(;/java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83 25
<<divjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
<div class="func"><< class""gapgt<>sclass=""task1 =DelayTaskP,1.5000];/>
<p><code class="func">DelayTask<<?xml version=10 ="-8?java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
<div class="func"><table<pan class"ContSS"<br/<class=nocss"&;nbsp;/span>< =chap1.#X7DEC1649841E3813">1.2-1 RunTask</a></span>
c"ScheduleAsyncTask/code>creates asynchronous like< class="unc><code < =c.#X7A86AE967D2A9E94"><span class="RefLink">1.2-2</span></a>), except that its result will be ignored.</p>
pjava.lang.StringIndexOutOfBoundsException: Index 130 out of bounds for length 130
dclass>span=tocline>span =nocss>nbsp;/><href"html#X86F8419B7968345B">1.3 <span class="Heading">Information about tasks</span></a>
<div class="func"><table class=span =ContSS>br>span="ocss"&bsp&<span>ahref"html#X8431B91487A8A3F1">1.4-2 TaskCancellationRequested</a></span>
< class=func"<code>starts varclass=Arg"task</>ifit alreadyrunning.Ithasonly effect if argumentis returned c =func><code < href=chap1h#X85BC2BBC7EF5B22E"><span class="RefLink">1.2-3</span></a>); otherwise, it is a no-op.</p>
id"X861BC1488345C424 =X861BC1488345C424>/a</java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
<h5>1.2-9 WaitTask</h5>
<div class="func"><table class="func" width="100%"><tr><td class"tdleft>codeclass=func>#java.lang.StringIndexOutOfBoundsException: Index 277 out of bounds for length 277
divclass""tableclass= =100"<>tclass"dleft>code=func>#8227;WaitTask</code>(< Arg><var></d>td class="dright>&;function <td>/tr></table></div>
<div class="funcspan>
p< class"">aitTask</ode> waitsuntilvarclass""task1/> through < class="rg">askn/var completed;after that .Alternatively,a <ode class=func><code orderto waituntil aconditionismet conditions code class""</>is an <ode class=func>/./>
81489CD684EA11B6 ""<a>pjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
<h5>1.2-10 WaitAnyTask</h5>
div="table =f"width="100%>tr>td class=tdleft"< class="&8227 WaitAnyTask<code> <var class=Arg><var> varclass=Arg"../,<class="taskn<var>)/><dclass=tdright"(nbspf&bsp)/><tr<table<divjava.lang.StringIndexOutOfBoundsException: Index 280 out of bounds for length 280 for anyof its arguments finish,then the of task</java.lang.StringIndexOutOfBoundsException: Index 137 out of bounds for length 137
<div class=example"<java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
< class=">ap&t<span><class=GAPinput> =DelayTask(-gt;ortedList() 321);/>
<span class="GAPprompt">gap></span> <span class="GAPinput">task2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 2
<span class="GAPprompt">gap></span> <span class="GAPinput">if which = 1then</span>
<span class="GAPprompt">></span> <span class="java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<span class="GAPprompt
<div class=example>prejava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
span class="APprompt>g;/><pan "GAPinput>fi<span
[ 4, 5, 6 ]
[ 1, 2, 3 ]
</pre></div>
<p>One can 1,2,3]
<p><a id=<pre>/>
<51211TaskResult/h5>
<div <p><codeclass=funcTaskResult</> (ahref".tml#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>
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p>If the function executed< class="GAPprompt"gap&<span s class""()<span>
>a=""name""<a<pjava.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
<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>
<div class="funcfunc>DelayTask<code < href=chap1.java.lang.StringIndexOutOfBoundsException: Range [199, 89) out of bounds for length 199
<p<panclass=GAPprompt&;<span> <span =GAPinput>: (Products class=GAPprompt"gap&t;</><span class"">task2 = DelayTask(Product,[5001.10000);<spanjava.lang.StringIndexOutOfBoundsException: Index 113 out of bounds for length 113
<java.lang.StringIndexOutOfBoundsException: Range [0, 3) out of bounds for length 0
<div class="func"><table class="func" <span class="GAPprompt">gap></span> <spa"APinput"TaskResult(()<spanjava.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
pT returns the runningtasks.Notethatitis approximation and tasks are byotherthreads<p
<p<> e.. you wanttocalla functiononly itssideeffects can ignoreresult a task codeclass=func></code> (href=chap1html#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>
<java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
<div class="func"><table class="func" width<class=GAPprompt"gap&t;/>< class=GAPinput>list<span>
<p>This --Thread0[java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
p< =""name=""><a></>
<</h5
<div class="func"><table class="func" width=!
<pg&tjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
<div class="func"><table class=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p>This java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
<p><a id="X7B286945821A3BBA
<h4>1.4 <span class="Heading">
<p>HPC-GAP uses a cooperative java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<div<5>.- ScheduleTask<h5>
<p><code class="func">CancelTask</code> submits a
<p><a id="X8431B91487A8A3F1" name="<p><code class="func">ScheduleTask</codeprepares for but c ="unc>/>(a=chap1html#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>
TaskCancellationRequestedh5>
<div class="<span class="GAP>g;/><class=GAPinput"t1: RunTaskx>*,3);/>
<code class="func"TaskCancellationRequested</>returns if<ode class""CancelTask/ < ".html#X86C26E3081C3C9AA"><span class="RefLink">1.4-1</span></a>) has been called for <var class="Arg">task</var>, false otherwise.</p>
<divclass"unc>table class""="%>tr< class""< class"unc>#8227; <code(<ar =Arg"exit_func/>)/td> =tdright"(;unction <td>/<table>/>
<p><> the could alsobe code=func></code>(a=chap1htmlX7DEC1649841E3813> class"".1/>/> < ="/>< =><code( =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>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">task
span class""&;/> <pan class">while <span>
<span class=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
sclass=GAPprompt>gt;span> class="APinput"> od;</span>
<span class="GAPprompt">></span> <span class="GAPinput"> end);;</span>
< =GAPprompt">><span>< class"GAPinput>(ask;/java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
< class="APinput"TaskResult(task);</span> 314
<pre>/>
<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<h5>1.4-4 OnTaskCancellationReturn</h5>
<div class="func"><table class="func"
>>java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 182
<p><a id="X802FC4C284F68696" name="java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 0
h15<""/>java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 52
<
pa"java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 62
<h4>1.6 <span class class=GAPprompt>gt/ span class""> =RunTaskx&txx, 4);<java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
<Milestonesare way to abstract conditionswhichmultipletaskscan ./>
<p><a id="X80CB3247854A46E4" name="X80CB3247854A46E4span class="gapgt;<span s =G"TaskResultt)/
<5>.- <h5java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
<div java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
p< classf></> createsa .argument alistoftargets must list or .If,thelistdefaults<odeclass"ode>0<code><p
<p><a id="X800AE2737CB715C5" name="X800AE2737CB715C5"><>code func>/>works as <ode =func"RunTask<code>(a="chap1htmlX7DEC1649841E3813>span =RefLink>.-<span</a>,butits start delayeduntil being waited for (ncluding by <codeclass""TaskResult/ < href"chap1.html#X7A86C732823E04B6"><span class="RefLink">1.2-11</span></a>)).</p>
<h5>1.6-2 ContributeToMilestone</h5>
<div class="<>code =">> asynchronous.Itworks code =func><code>(< "h#X7DEC1649841E3813"><span class="RefLink">1.2-1</span></a>), except that its result will be ignored.</p>
<p>The <code java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
<p><a id="X7ACB26D38096CD56" name=java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
1 java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 31
<
p< =""AchieveMilestone/>functionajava.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 347
<div class=
spanjava.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 90
<span << =/>starts<var =Arg>ask</ar>ifitisnot already aneffectif is returned by<class="func"D<code>(a href=.java.lang.StringIndexOutOfBoundsException: Range [312, 240) out of bounds for length 312
</pre></div>
<pjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<p><a id="X83E7AF007E040FB9" name="X83E7AF007E040FB9">div""><tableclass=func "%>tr<d class=tdleft<ode ">#java.lang.StringIndexOutOfBoundsException: Index 223 out of bounds for length 223
<class="xample">pre
<The< class=func><code waitsfor ofits finish returnsthe numberof thattask<pjava.lang.StringIndexOutOfBoundsException: Index 137 out of bounds for length 137
<<span""gapgt/ span => : (-gt;ortedList,[,,];<span>
<span class="GAPprompt">gap></span> <span <span class="GAPprompt">gap></span> <span classtask2: (-g;SortedListx,654);/>
false
<span class="GAPprompt">gap></span> <spanjava.lang.StringIndexOutOfBoundsException: Range [24, 1) out of bounds for length 86 ""gapg;/ <pan class">(;/java.lang.StringIndexOutOfBoundsException: Range [92, 93) out of bounds for length 92
true
</pre></div
<java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
<div
<hr />
pclass="foot">generated by <a href<>The cclass=func>/> foro itsarguments inish number ofttask</java.lang.StringIndexOutOfBoundsException: Index 137 out of bounds for length 137
/java.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
/java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.260Angebot
¤
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.