BAP Online Manuals : Library Reference : Library by Name : alloc_server
Previous: < , =< , > , >=
Next: append

6.2.7. alloc_server

allocates are server for private use

SYNOPSIS

INCLUDE 'sysman.h'
alloc_server(ServerID)

SYNTAX

alloc_server(ServerID) (i) (o)

ARGUMENTS

server(ServerID) Process ID of the allocated server.

DESCRIPTION

Allocates a server from the public server pool for private used. ServerID may be partially initalized, e.g. to get a server on a certain note. The server should be returned with the free_server () predicate if no longer needed.
NOTE: If you pass the ID to the exec () or xcall () predicates, it will be return automatically after use.

EXAMPLE

get_my_id(MyID),
alloc_server(ID),
exec(ID,send_msg(MyID,done)),
rec_msg(ID,Result),
write(Result),nl,

ERRORS

No runtime errors. If a server is to be allocated, the process might suspend if no server is available.
This may cause deadlocks!

LAYERS

client-server

RELATED PREDICATES

dcall , exec , xcall , claim_processes , create_processes


BAP Online Manuals : Library Reference : Library by Name : alloc_server
Previous: < , =< , > , >=
Next: append