simultaneous open queries
Edd Barrett <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <20140318134803.GT13240__27178.1440046199$1395150580$gmane$org@kryten3.home> |
Hi, I am currently trying to get by head around the restrictions relating to simultaneous queries in a single threaded program that uses the SWI Prolog C API. We are told in the docs [0] that "a foreign context can have at most one active query" and that "we are "not allowed to open multiple queries and start generating solutions for each". So it seems that we are limited (at least without threading?) to one simultaneous query per calling context. Now, a calling context is an instance of module_t; the type used to refer to a Prolog module. I am having difficulty understanding what exactly this means in the sense of a calling context. Does it mean that in order for simultaneous queries to be open, the "callers" must be defined in different modules? I can't seem to find any documentation describing the role of a calling context (other than it is a module). Asked differently, is it possible to have simultaneous queries open in a single threaded C application at all? Perhaps we can use the outcomes of this discussion to improve the documentation. [0] http://www.swi-prolog.org/pldoc/man?section=foreign-create-query -- Best Regards Edd Barrett http://www.theunixzoo.co.uk