calls its argument as a goal on a separate process
INCLUDE 'sysman.h' xcall(Goal)
xcall(Goal) (i) xcall(ServerID,Goal) (i,i)
void(Goal) (i) Goal to be called
server(ServerID) Process on which Goal is called
A server is allocated if ServerID is only partially initialised, unbound, or not provided. The
Goal is called on that server, and the current process is suspended until the first solution is
found. This solution will be matched with the Goal. While the calling process evaluates the first
solutions, the other process continues to satisfy the goal as if backtracking has already occurred.
When the goal finally fails or succeeds, the process is returned to the public server pool.
This predicate allows you to create easily multitasking applications from existing programs.
Please consult the Language Tutorial for a detailed description.
NOTE: xcall() uses the
call
() predicate, thus the same
restrictions apply!
IMPORTANT NOTE: Cutting backtracking over an xcall() may result in unpredictable results in
the version of BAP.
xcall( Generate(X)), test(X), write(X),nl, fail.
No runtime errors. If a server is to be allocated, the process might suspend if no
server is available.
This may cause deadlocks!
client-server
alloc_server , call , exec , dcall , send_msg , rec_msg