Re: Multiple instances for embedded prolog interpreter

Uwe Lesta <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <DADDA4CE0F00374BB9EA2BEDBFF2CCDF5B926227BB@SERVER.SBS.SBS-Softwaresysteme.de>
Hi Stefan,

In the manual see: 8 Multithreaded applications
	http://www.swi-prolog.org/pldoc/man?section=threads

And there specially 8.7 Multithreaded mixed C and Prolog applications
	http://www.swi-prolog.org/pldoc/man?section=foreignthread

hope this helps

--

Uwe 



> -----Original Message-----
> From: [email protected]
> bonn.de [mailto:swi-prolog-bounces+lesta=sbs-
> [email protected]] On Behalf Of Stefan Radomski
> Sent: Tuesday, July 23, 2013 2:23 PM
> To: [email protected]
> Subject: [SWIPL] Multiple instances for embedded prolog interpreter
> 
> 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
> 
> _______________________________________________
> SWI-Prolog mailing list
> [email protected]
> https://lists.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.