|Did you know ...||Search Documentation:|
|Pack canny_tudor -- prolog/swi/pengines.pl|
The implementation utilises a mutable state dictionary to pass event-loop arguments and accumulate results. So quite useful. Note also that the second Goal argument is not module sensitive. There consequently is no meta-predicate declaration for it.
The arity-2 form of pengine_collect expects that the pengine_create options have asked a query. Otherwise the collect waits indefinitely for the engines to stop.
It is possible that the engine could exit before the collector asks for results. Prolog engines operate asynchronously. The collect handler pre-empts failure and avoids an ask-triggered exception by only asking existing engines for results. This does not eliminate the possibility entirely. It only narrows the window of opportunity to the interval in-between checking for existence and asking.
The implementation makes internal assumptions about the pengines module. It accesses the dynamic and volatile predicates current_pengine/6 and child/2. The latter is thread local.
The following predicates are exported, but not or incorrectly documented.