evaluates f[argi] in parallel, returning the first result received.


returns a list of the first k results.

Details and Options

  • ParallelTry automatically distributes computations among different available kernels and processors.
  • Any evaluations still underway after k results have been received are aborted.
  • If the result from evaluating one of the f[argi] is $Failed, then it is ignored.
  • If no results other than $Failed are obtained, ParallelTry returns $Failed.
  • ParallelTry[f,{arg1,arg2,}] allocates evaluations of the f[argi] to different kernels and processors, starting with arg1.
  • If there are more argi than kernels, then some of the argi will not be tried unless earlier ones return $Failed.
  • ParallelTry takes the same DistributedContexts option as ParallelTable.


open all close all

Basic Examples  (2)

Find the factorization of a number that is easy to factorize:

Click for copyable input

Nondeterministically find a prime in a given range:

Click for copyable input

Scope  (2)

Options  (5)

Applications  (5)

Properties & Relations  (5)

Possible Issues  (3)

Introduced in 2008
Updated in 2010