With the introducing of the async API the Prolog interpreter is
able to process promises when in async mode. So far sleep/1 is the
first predicate that relinquishes control. Further opportunities
for the future will be input/output predicates. Last but not least
the frequent garbage collection can be used to relinquish control
on a regular basis.
While there exists a primordial task “main”, the application programmer can create further tim-ers and/or tasks. The realization is via stack-less coroutines for timers and stack-full coroutines for tasks. The stack-less coroutines are executed inside their creator stack-full coroutine and are not allowed to yield.
The following timer predicates are provided: