embedded and threaded - in java

[email protected] (Meg Crocker)
Newsgroups perl.jpl,perl.ithreads
Message-ID <[email protected]>
Hi!

    Has anyone embedded perl in java with threads or multiple
interpreters?

    I'm trying to build something based on JPerl
(http://search.cpan.org/author/SBALA/jp_beta_1/) and I think I'm
running up against my clue barrier - I'm seeing segfaults and panics
("panic: top_env") when I try to run stuff, even with a single thread.

    I sprinkled in PERL_SET_CONTEXTs liberally, pretty much at the
beginning of any jperl function that uses a perl_ function or a perl
macro...

    Tips would be terribly appreciated.  I'm using perl5.8.0 and java
1.3 (hotspot jvm) on solaris 8.  Here's a stupid question to get you
started: My java is linked against libthread; perl seems to prefer
libpthread.  Do I need to make perl use libthread?  It looks like 
libpthread uses libthread itself...

Also:
    - Do I need to "use threads" or any thread functions in my perl?
    I haven't yet - I've started with a single interp called from a
    single java thread.  But I read in one older message that perl
    takes shortcuts if it doesn't think the thread stuff will actually
    be used?

    - Would all this be simpler with a mere multiplicity perl instead
      of a multiplicity-ithreads perl?  I think I'd still need to be
      able to call each interpreter from multiple threads to get the
      performance characteristics I'm looking for.

Thanks.  :(
Meg Crocker
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.