From jan@swi.psy.uva.nl Thu Sep 27 10:13:13 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f8R8DDv29694;
	Thu, 27 Sep 2001 10:13:13 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f8R8DDX26185;
	Thu, 27 Sep 2001 10:13:13 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: "Nissim Broudo" <nissim@math.ufl.edu>, <prolog@swi.psy.uva.nl>
Subject: Re: [SWIPL] Calling more than one predicate
Date: Thu, 27 Sep 2001 10:06:39 +0200
X-Mailer: KMail [version 1.0.29.2]
Content-Type: text/plain
References: <200108070053.MAA507668@atlas.otago.ac.nz> <002101c11f43$0ebe31a0$8453e30a@computer>
In-Reply-To: <002101c11f43$0ebe31a0$8453e30a@computer>
MIME-Version: 1.0
Message-Id: <01092710131305.25592@gollem>
Content-Transfer-Encoding: 8bit

On Tue, 07 Aug 2001, Nissim Broudo wrote:
>I've been using SWI-Prolog for a short amount of time and I completed one
>small project in inductive logic programming using SWI.  I'm very impressed
>with the package and its ease of use and extendibility with C.
>
>What's the feasibility of being able to call more than one predicate in
>future versions of SWI-Prolog ?  I would like to have 2 open predicates
>
>qid1 = PL_open_query(NULL, PL_Q_NORMAL, my_predicate_1, term1);
>qid2 = PL_open_query(NULL, PL_Q_NORMAL, my_predicate_2, term2);
>
>PL_next_solution(qid1);
>PL_next_solution(qid2);
>
>PL_close_query(qid1);
>PL_close_query(qid2);
>
>Nissim Broudo
>
>Department of Mathematics &
>Department of Molecular Genetics and Microbiology
>University of Florida

Trying this results in undefined behaviour.  The system is prepared to
have  multiple solving engines as used in the multi-threading version. 
It wouldn't be hard to launch a second solving engine in the same
thread, except many of the foreign function won't know what engine
you're talking about (there is no argument to specify this).  The
multi-threaded uses `thread-local data' to find out, but this is not
an option for the single threaded version.

	Regards --- Jan

