WaitNext

WaitNext[{eid1,eid2,}]

waits until the first evaluation represented by any of the eidi finishes, then returns its result, the corresponding eidi, and the list of remaining eidk.

Details

  • The eidi are EvaluationObject expressions obtained by submitting expressions for concurrent evaluation using ParallelSubmit.
  • WaitNext[{eid1,eid2,}] returns a list {res,eid,eids}, where res is the result of the finished evaluation, eid is its EvaluationObject, and eids is the list of remaining evaluations.
  • The last element in the list produced by WaitNext is suitable for another call to WaitNext.

Examples

open allclose all

Basic Examples  (1)

Submit a number of integer factorizations:

In[1]:=
Click for copyable input
Out[1]=

Wait until the fastest one is done:

In[2]:=
Click for copyable input
Out[2]=

Wait for the next one:

In[3]:=
Click for copyable input
Out[3]=

Finally, wait for all remaining ones:

In[4]:=
Click for copyable input
Out[4]=

Applications  (1)

Properties & Relations  (2)

Possible Issues  (2)

See Also

WaitAll  ParallelSubmit  ParallelTry  EvaluationObject

Introduced in 2008
(7.0)