Subject: [SWIPL] Not able to use multithreading features of prolog

From: [email-masked]
Date: Wed, 5 Dec 2001 17:14:38 +0530

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