[Tcl Java] Re: thread cleanup - something that works
> Well, thread support was just added recently so before that > having two interps in the same thread was the only way > you could create two interps, cause there was only one thread. > > Besides that, it is nice to be able to have a child interp > to run things in. It provides the ability to run safe interps > and that sort of thing. For example, in Source-Navigator we > use a child interp for each project file. Each project > has its own copies of global Tcl variable and commands. In aolserver one probably wouldn't need to do these types of things, but who knows? Since aolserver provides its own api for registering thread exit and cleanup procs, I could also use those. I'm guessing that they might have disabled the tcl-specific calls in favor of the aolserver api functions. For now, I can live with one interpreter per thread, but I can't live with the memory leaks, so I'm going to pursue that. When I get the memory leaks taken care of, I'll come back to this thread cleanup issue. -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
[Tcl Java] Re: thread cleanup - something that works
On Tue, 17 Oct 2000, Daniel Wickstrom wrote: > I was never able to get Tcl_CreateThreadExitHandler to work for either > the TclThreadCleanup or the JavaCacheCleanup routines. As a > work-around I decided to call both of these cleanup routines at the > end of the JavaInterpDeleted function. I've run this setup under > load, and other than leaking memory, I've had no problems. If you create only one Tcl interp in a thread, the might work. It is not going to work in the more general case as multiple Tcl interps can exist in one thread. Just run: % interp create And you got two right there! Perhaps it is a problem with some init code that is not getting run in the Tcl interp. What part of Tcl calls those callbacks? Mo DeJong Red Hat Inc 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
[Tcl Java] thread cleanup - something that works
I was never able to get Tcl_CreateThreadExitHandler to work for either the TclThreadCleanup or the JavaCacheCleanup routines. As a work-around I decided to call both of these cleanup routines at the end of the JavaInterpDeleted function. I've run this setup under load, and other than leaking memory, I've had no problems. I now suspect that the memory leaking is due to a problem with reference counting. I'm currently investigating that issue. -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
[Tcl Java] Re: [Tclblend] accessing inner class?
On Tue, 17 Oct 2000, Jens Schliephacke wrote: > Good morning dear list! Humm, I was just going to bed. > I'm having a problem using the javax.mail API directly from tcl. > I'm using tclblend 1.2.5 an I have to get this Java code done from tcl: > > // Examine ALL system flags for this message > Flags flags = m.getFlags(); > Flags.Flag[] sf = flags.getSystemFlags(); > for (int i = 0; i < sf.length; i++) { > if (sf[i] == Flags.Flag.DELETED) > System.out.println("DELETED message"); > > All works fine, except accessing the inner class fields! > [java::field javax.mail.Flags.Flag DELETED] does not work, neither does > [java::field javax.mail.Flags Flag.DELETED]. I think you want to use: java::field javax.mail.Flags\$Flag DELETED It is a wacky hack that the Java designers decided to throw into 1.1 so that they did not have to change the VM spec. Rather ugly if you ask me. Mo DeJong Red Hat Inc 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