Multithread Query with JPL

I’m using: SWI-Prolog version 8.0.2 and I want to query via JPL in multi-thread programs. Is there any tutorial someone can share?

Start upgrading to the latest version. Several issues with JPL have been fixed, notably concurrency related issues. JPL’s default model is to maintain a pool of Prolog engines and a call from JPL from any thread uses an arbitrary engine from this pool. So, it “works”, but you have to be careful with (avoid) Prolog thread-local data. The most recent versions of JPL also allow for a one-to-one mapping where a Java thread creates a Prolog engine it talks to (and should discard this engine before the Java thread terminates).

These features should be what I’m looking for :grin:

Is there any guide about how to use these features in JPL? I searched in SWI-Prolog but didn’t find introduction of these features.