Logtalk reference manual
Built-in predicate: threaded/1

threaded/1

Description

threaded(Conjunction)

Proves each goal in a conjunction of goals in its own thread. The argument can also be a conjunction of messages, either to self or to an explicit object. A call to this predicate blocks until all individual threads terminate. This predicate is deterministic and opaque to cuts, similar to once/1.

Template and modes

threaded(+callable)

Errors

Conjunction is a variable:
instantiation_error
A goal in Conjunction is a variable:
instantiation_error
Conjunction is neither a variable nor a callable term:
type_error(callable, Conjunction)
A goal Goal in Conjunction is neither a variable nor a callable term:
type_error(callable, Goal)

Examples

Prove a conjunction of goals, each one in its own thread:
threaded((Goal, Goals))
Prove a conjunction of messages to self, each one in its own thread:
threaded(::(Message, Messages))
Prove a conjunction of messages to an object, each one in its own thread:
threaded(Object::(Message, Messages))
Prove a conjunction of objects receiving the same message, each one in its own thread:
threaded((Object, Objects)::Message)