threaded_race((Goal; Goals))
Prove a disjunction of goals asynchronously using a new thread. This call always succeeds. The call is equivalent to the competing calls of the individual goals: when one of the goals succeeds, the other ones are aborted (i.e. their threads are terminated). The result (of the first goal to succeed) is sent back to the thread of the object containing the call (this). The corresponding threaded_exit/1
goal must match all the goals in the disjunction. This is useful when you have a set of different methods to solve a problem without knowing a priori which one will lead to the fastest result.
threaded_race(+callable)
instantiation_error
type_error(callable, Goal)
threaded_race((Goal; Goals)
threaded_race(::(Message; Messages))
threaded_race((Object::(Message; Messages))