I’m using: SWI-Prolog version 8.03.
We need to run our application in parallel. We used “Multithreaded mixed C and Prolog applications” – https://www.swi-prolog.org/pldoc/man?section=foreignthread. I want the code to share some big relations across the threads. Meanwhile, we also need to create smaller and unique relations in each thread. Each thread needs to run the queries against all the relations, small and big.
I tried to allocate threads through C (Python actually, but under the hood, it’s the same). I then assign each thread a separate prolog engine using PL_thread_attach_engine(NULL) function. However, when I run the query, I always get the “nested query” error - “NestedQueryError: The last query was not closed”.
Is it possible to do this?