Multiple instances for embedded prolog interpreter
Stefan Radomski <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <0B861307-97BB-43B9-83A7-C84F2FBEB1DF@tk.informatik.tu-darmstadt.de> |
Hey there, we embedded SWI prolog as a logic engine via its C++ interface and it's working great. But we do need more than one instance of the PLEngine or at least distinct states. Seeing that PL_initialise will just initialize a global prolog interpreter, and the foreign predicates will not receive any kind of callbacks, we figured that there can only ever be one instance per runtime. If that's the case, can we "simulate" multiple instances i.e. by swapping the interpreters state before calling any of the PL* functions? We do not necessarily need concurrency, just distinct states. We pondered about using several PLFrames to achieve something like that but it seems that they will just "rollback" any term references when closing. If this issue has been discussed previously, please be so kind as to provide a link. Best regards Stefan Radomski --- FB20 Telecooperation | Darmstadt University of Technology Hochschulstr. 10 | D-64289 Darmstadt Germany | Room S2|02 / A108 Tel +49 (6151) 16-6670 | Fax +49 (6151) 16-3052