From mfamir@hss.hns.com Wed Dec  5 12:42:50 2001
Received: from hindon.hss.co.in ([202.54.26.202])
	by swi.psy.uva.nl (8.10.2+Sun/8.11.2) with ESMTP id fB5Bgmk11477
	for <prolog@swi.psy.uva.nl>; Wed, 5 Dec 2001 12:42:48 +0100 (MET)
Received: from sandesh.hss.hns.com (localhost [127.0.0.1])
	by hindon.hss.co.in (8.10.0/8.10.0) with SMTP id fB5Bhx008302
	for <prolog@swi.psy.uva.nl>; Wed, 5 Dec 2001 17:13:59 +0530 (IST)
Received: by sandesh.hss.hns.com(Lotus SMTP MTA v4.6.3  (733.2 10-16-1998))  id 65256B19.0040633C ; Wed, 5 Dec 2001 17:13:17 +0530
X-Lotus-FromDomain: HSS
From: mfamir@hss.hns.com
To: prolog@swi.swi.psy.uva.nl
Message-ID: <65256B19.004061FF.00@sandesh.hss.hns.com>
Date: Wed, 5 Dec 2001 17:14:38 +0530
Mime-Version: 1.0
Content-type: text/plain; charset=us-ascii
Content-Disposition: inline
Subject: [SWIPL] Not able to use multithreading features of prolog



Hi,

I am not able to use multithreading features of prolog. My OS is Solaris2.7.

I followed the undermentioned procedure for installing the version 4.0.11.

1. After gzip and untar and going to "pl-4.0.11/src", ran "./configure
--prefix=$HOME/SWIProlog/Prolog-4.0.11"
2. Ran "gmake".
3. Ran "gmake install".

The above steps were successful and the directory structure was formed as
expected. The three binaries were
present in directory
"$HOME/SWIProlog/Prolog-4.0.11/lib/pl-4.0.11/bin/sparc-solaris2.7"
with links to them created at directory "$HOME/SWIProlog/Prolog-4.0.11/bin".

Now I ran the prolog session with the following sample file:

====================================================
main :-
    thread_create(first, _Id1, []),
    thread_create(second, _Id2, []),
    write('Threads Created'), nl, nl, nl.

first :-
    write(' I am FIRST'), nl.

second :-
    write(' I am SECOND'), nl.
====================================================

The prolog session with the file is also mentioned as under:

=================================================
Welcome to SWI-Prolog (Version 4.0.11)
Copyright (c) 1990-2000 University of Amsterdam.
Copy policy: GPL-2 (see www.gnu.org)

For help, use ?- help(Topic). or ?- apropos(Word).

?- [mul_th].
% mul_th compiled 0.01 sec, 1,444 bytes

Yes
?- main.
ERROR: Undefined procedure: thread_create/3
?-
================================================


I also noticed that in Makefile, there is some description about the
multithreaded prolog.

Then used the command "make install-mt". There was another link created in the
directory
"$HOME/SWIProlog/Prolog-4.0.11/bin" with name "pl-mt".

I ran the above prolog session with pl-mt just to find the same error as
mentioned above.

Please help me use the multithreading feature of prolog correctly.

Thanks in advance,
Amir


