8.2 Multiple SICStus Runtimes in C

Unless otherwise noted, this section documents the behavior when using dynamic linking to access a SICStus runtime.

The key implementation feature that makes it possible to use multiple runtimes is that all calls from C to the SICStus API (SP_query(), etc.) go through a dispatch vector. Two runtimes can be loaded at the same time since their APIs are accessed through different dispatch vectors.

By default, there will be a single dispatch vector, referenced from a global variable (sp_GlobalSICStus). A SICStus API functions, such as SP_query(), is then defined as a macro that expands to something similar to sp_GlobalSICStus->SP_query_pointer. The name of the global dispatch vector is subject to change without notice; it should not be referenced directly. If you need to access the dispatch vector, use the C macro SICStusDISPATCHVAR instead; see below.

Send feedback on this subject.