We are working on big telecommunication project. We have a lot of
Tcl scripts which glue many Java applications talking to them using
Corba. Now we would like to implement everything using TclBlend. Some of
our scripts sometimes take 15 minutes of more to execute so we need
multithreaded calls to interpreter. Our platform now is Solaris-Sparc. I
have made little example to try tclBlend with multithreading in Java
1.2.2 and Tcl 8.3.2 environment. But whatever I do and whatever
LD_LIBRARY_PATH I define my example always fails. Below is source in
Java and messages. It looks like I am not able even create Interp
object. I tried to create Interp in main thread. It fails with the same
result. Some additional information: this test runs perfectly with Jacl.
When I go to jtclsh for tclBlend I am able to create java::Interp and
submit scripts and it works fine. I downloaded version tclBlend 1.2.6
and built version with gcc. I built Tcl also using gcc. Any help would
be very much appreciated.
import tcl.lang.*;
public class MyJavaMain {
public static void main (String[] args) {
System.out.println("Main started.");
TclInterpreterThread thread = new TclInterpreterThread("a.tcl");
TclInterpreterThread thread1 = new
TclInterpreterThread("a1.tcl");
thread.start();
thread1.start();
}
}
class TclInterpreterThread extends Thread {
public tcl.lang.Interp mInterp = null;
private String scr;
public TclInterpreterThread (String s) {
scr = s;
}
public void run () {
System.out.println("Thread for " + scr + " started.");
mInterp = new Interp(); // OK. The run() method is invoked
// by the thread
"TclInterpreterThread".
// This call makes
"TclInterpreterThread"
// the interpreter thread, which is
// desired.
System.out.println("Interp created. Script " + scr + " will be
performed");
try {
mInterp.evalFile(scr);
System.out.println("evalFile is over for " + scr);
}
catch(TclException e) {
System.out.println("Exception " + e);
}
}
}
********************************* Messages
************************************************************************
*****************
Main started.
Thread for a.tcl started.
Thread for a1.tcl started.
SIGSEGV 11 segmentation violation
si_signo [11]: SEGV
si_errno [0]:
si_code [1]: SEGV_MAPERR [addr: 0x4]
stackpointer=EF0410E8
Inconsistent thread : best efforts attempt (may fail)
"Thread-3" (TID:0x17e9c8, sys_thread_t:0x17e908, state:MW, thread_t:
t@1, threadID:0x25118, stack_bottom:0xf0000000, stack_size:0x800000)
prio=5
-------------------
Inconsistent thread : best efforts attempt (may fail)
"Thread-2" (TID:0x10aa18, sys_thread_t:0x10a958, state:R, thread_t: t@8,
threadID:0xee7e1dd8, stack_bottom:0xee7e2000, stack_size:0x20000) prio=5
[1] TclInterpreterThread.run(MyJavaMain.java:21)
-------------------
Inconsistent thread : best efforts attempt (may fail)
"Thread-1" (TID:0x21f6a0, sys_thread_t:0x21f5e0, state:R, thread_t: t@7,
threadID:0xef041dd8, stack_bottom:0xef042000, stack_size:0x20000) prio=5
*current thread*
[1] tcl.lang.Interp.create(Native Method)
[2] tcl.lang.Interp.<init>(Interp.java:130)
[3] TclInterpreterThread.run(MyJavaMain.java:21)
-------------------
Inconsistent thread : best efforts attempt (may fail)
"Finalizer" (TID:0x156578, sys_thread_t:0x1564b8, state:CW, thread_t:
t@6, threadID:0xef0f1dd8, stack_bottom:0xef0f2000, stack_size:0x20000)
prio=8
[1] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:146)
[2] java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:168)
[3]
java.lang.ref.Finalizer$FinalizerWorker$FinalizerThread.run(Finalizer.ja
va:124)
-------------------
Inconsistent thread : best efforts attempt (may fail)
"Reference Handler" (TID:0x14fe98, sys_thread_t:0x14fdd8, state:CW,
thread_t: t@5, threadID:0xef121dd8, stack_bottom:0xef122000,
stack_size:0x20000) prio=10
[1] java.lang.Object.wait(Object.java:424)
[2] java.lang.ref.Reference$ReferenceHandler.run(Reference.java:130)
-------------------
Inconsistent thread : best efforts attempt (may fail)
"Signal dispatcher" (TID:0x13b9e0, sys_thread_t:0x13b920, state:MW,
thread_t: t@4, threadID:0xef161dd8, stack_bottom:0xef162000,
stack_size:0x20000) prio=10
-------------------
mblend[18]: 27688 Abort(coredump)
Joe Freydlin
Tel. 913-315-6666
[EMAIL PROTECTED]