Jiang,

thanks for the response

You can do:

        Tcl Thread A -> package require java -> start JVM ...
        Tcl Thread B -> send request to Tcl thread A for Java work using
message passing on the event queue of A
        Tcl Thread C -> send request to Tcl thread A for Java work ...
       ...

I don't think this will work because the Java-side code can have one thread
block while waiting for another thread's work to complete.  For example:
        Tcl Thread A -> package require java -> start JVM ...
        Tcl Thread B -> send request to Tcl thread A for Java work.  Blocks until
                          work from Tcl Thread C completes
        Tcl Thread C -> send request to Tcl thread A for Java work

Tcl Thread C above will not be able to run because Tcl Thread B has tied up the single connection to the JVM, and Tcl Thread B needs C to complete.  I.e., the system would deadlock.

Any other thoughts appreciated.  At this point I'm about to give up on using TclBlend and rework my software to use a different approach that avoids the whole tclblend/tclthreading problem
 - Mike

Reply via email to