Problem with Eclipse/C - Interface

From: Peter Baumgartner <peter_at_uni-koblenz.de>
Date: Mon 20 Aug 2001 09:08:27 AM GMT
Message-ID: <15232.54155.605328.453852@gargle.gargle.HOWL>
Dear Eclipse people,

there is a problem in the Eclipse/C - Interface. It is documented in
the session log below. I tried _hard_ to get my program running, but I
had to give up (I even read the embedding manual ;-). Certainly I am
still doing something foolish, possibly due to a misunderstanding of
underlying concepts, in particular non-volatileness of ec_refs.


The problem I try to solve is the following: given a set of terms
(about 50000 terms expected), store them indexed by integers.
I tried it with a global array, and did something like
  
store(Index,Item) :-
  setval(bla_array(Index),Item).

In principle this works fine, but retrieval is _far_ too slow.
Respective getval-retrievals occur frequently, and they eat up 
more than 50% of the total runtime. Had I a fast way to store terms
indexed by number, my program runtime would be acceptable. Any clues
how that could be done (I also tried simulating an array by a
structure, but that is even much slower).

Any advice would be highly appreciated!


My makefile entry to create .so-files is 

%.so : %.c
        cc -O2 -DPC  -I/usr/local/eclipse/include/i386_linux $*.c -shared -o  $*.so

I am using gcc 2.95.4. With these settings I can compile and run the
examples coming with eclipse without problems.

Help!

	Peter

And here is the session log (libc2.1 based linux pentium running on
Debian/Gnome linux, kernel 2.4.5), the respective files are included below

[~/PROVER/KRHYPER] eclipse
ECLiPSe Constraint Logic Programming System [kernel]
Copyright Imperial College London and ICL
Certain libraries copyright Parc Technologies Ltd
GMP library copyright Free Software Foundation
Version 5.2 #10, Tue Jun 26 02:14 2001
[eclipse 1]: [ep_array].
ep_array_interface.so loaded
ep_array.pl compiled traceable 0 bytes in 0.00 seconds

Yes (0.00s cpu)
[eclipse 2]: array_init(10000).
0 Size: 10000

Yes (0.00s cpu)
[eclipse 3]: array_put(1,f(a)).

Yes (0.00s cpu)
[eclipse 4]: array_put(2,f(b)).

Yes (0.00s cpu)
[eclipse 5]: array_put(3,f(c)).

Yes (0.00s cpu)
[eclipse 6]: array_get(1,X).


*** ECLiPSe fatal error: Fatal signal caught in protected code





-- 
Peter Baumgartner           peter@uni-koblenz.de
Tel. +49 261 287-2777       http://www.uni-koblenz.de/~peter/







Received on Mon Aug 20 10:09:36 2001

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:08:09 PM GMT GMT