>>>>> "Mo" == Mo DeJong <[EMAIL PROTECTED]> writes:
Mo> There are two cleanup cases.
Mo> TclThreadCleanup is called when a Tcl thread (one that was not
Mo> started inside a JVM) is terminated. TclThreadCleanup will
Mo> just call DetachCurrentThread() to disconnect the Tcl thread
Mo> from the JVM.
Mo> JavaCacheCleanup should be called when a Java or Tcl thread is
Mo> terminated, its job is to clean up the thread local cache or
Mo> classes.
For me these two cases seem to be one in the same. At the end of a
connection thread, I need to do both JavaCacheCleanup and
DetachCurrentThread.
Mo> I am not sure which of these you are using because the
Mo> description below says "Connection thread starts" and then
Mo> "jvm attach to the current connection thread", that would make
Mo> me think it is a thread created from Tcl.
I think what you're saying is correct. I've always thought of it as
aolserver starting a connection thread and allocating a tcl
interpreter instance to run in that thread. The jvm attach is done at
the start of the thread by a registered proc, and after the jvm is
attached to the connection thread, tclblend is initialized.
>> 1) Connection thread starts. 2) A new tcl interpreter is
>> allocated to the connection thread. 3) jvm attach to the
>> current connection thread. 4) tclblend is initialized for the
>> current connection thread. 4) run tcl scripts with tclblend
>> calls. 5) thread completes. 6) cleanup thread function is
>> called. <-- this doesn't happen with aolserver
Mo> The problem I was seeing is that JavaCacheCleanup was getting
Mo> called when I exited Tcl thread but when the JVM exited, I saw
Mo> no such callback. This might be because the finalizer was not
Mo> called on exit. I need to fix that problem with the Notifier
Mo> before I can really test this properly.
I would be happy to see it called at the end of a thread, because I
don't exit the jvm until aolserver is shutdown.
-Dan
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com