From: Vitor S. C. <vs...@gm...> - 2014-06-15 12:19:12
|
Dear Davide. Sorry for the delay > is it possible to create multiple prolog interpreters in the same C/C++ > program? Yes, if you have -DTHREADS (or if you use --enable-threads). > As far as I know, functions such as YAP_FastInit and YAP_RunGoalOnce are > global, so I cannot initialize multiple instances. FastInit will create a single database, thaat will be shared by all threads. But threads can run separate, and RunGoal shsould be thread-local. Have a look at YAP_ThreadCreateEngine, YAP_ThreadAttachEngine, YAP_ThreadDetachEngine, YAP_ThreadDestroyEngine. YAP also supports the thread creation ops in the SWi interface: PL_thread_self() PL_unify_thread_id() PL_thread_attach_engine() PL_thread_destroy_engine() PL_thread_at_exit() > In particular, I'm creating a c++ class that calls yap, so I would like > to create a new instance of yap prolog every time I create a new object > of the class. Thus every object will call and use yap independently in > the same c++ program. You may want to have a look at the directory CXX in yap-6.3.4. It is designed to interface with the swig package, but it is growing quickly. Any feedback, extensions or patches will be much appreciated! Vitor > > thanks! > > regards, > Davide > > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm > > ------------------------------------------------------------------------------ > HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions > Find What Matters Most in Your Big Data with HPCC Systems > Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. > Leverages Graph Analysis for Fast Processing & Easy Data Exploration > http://p.sf.net/sfu/hpccsystems > _______________________________________________ > Yap-users mailing list > Yap...@li... > https://lists.sourceforge.net/lists/listinfo/yap-users |