[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Jiang Wu
> -Original Message- > From: Mike Schwartz [mailto:[EMAIL PROTECTED]] > > I thought it was the JNI / C code side that wasn't thread > safe. You're > saying it's the Interp pure Java code that's the problem? In > that case > you could define an abstract class with all the Interp interf

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Jiang Wu
returns the Interp. -- Jiang Wu [EMAIL PROTECTED] > -Original Message- > From: Mike Schwartz [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 25, 2000 3:58 PM > To: Mo DeJong > Cc: [EMAIL PROTECTED] > Subject: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking >

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mo DeJong
On Tue, 25 Jul 2000, Mike Schwartz wrote: > > > I think if it's going to be non-thread safe then the code should sanity > > > check for thread-crossing calls, perhaps with #ifdef's so performance > > > concerns can be removed for people who don't want the sanity checks. > > > > I like this a

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mike Schwartz
> > I think if it's going to be non-thread safe then the code should sanity > > check for thread-crossing calls, perhaps with #ifdef's so performance > > concerns can be removed for people who don't want the sanity checks. > > I like this approach, but the problem is that there is no way to

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mo DeJong
On Tue, 25 Jul 2000, Mike Schwartz wrote: > Well, this is a matter of personal taste I suppose, but in my view > making non-threadsafe code in this day-and-age, especially code that is > intended to interoperate with a language (Java) that is designed to > make it easy to build threaded apps, is

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mike Schwartz
000 15:31:39 -0700 (PDT) > From: Mo DeJong <[EMAIL PROTECTED]> > To: Mike Schwartz <[EMAIL PROTECTED]> > cc: [EMAIL PROTECTED] > Subject: Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads > > > On Tue, 25 Jul 2000, Mike Schwartz

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mo DeJong
On Tue, 25 Jul 2000, Mike Schwartz wrote: > Hmm, I just realized that the issue is the Interp.eval code isn't thread > safe, so it just needs to run in a single Java thread (not necessarily the > Java main thread). So the code I suggested below won't work but you get the > idea -- have the code

[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mike Schwartz
IL PROTECTED]> > From: Mike Schwartz <[EMAIL PROTECTED]> > Cc: [EMAIL PROTECTED] > Resent-From: [EMAIL PROTECTED] > X-Mailing-List: <[EMAIL PROTECTED]> archive/latest/1044 > X-Loop: [EMAIL PROTECTED] > Resent-Sender: [EMAIL PROTECTED] > Subject: [Tcl J

[Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mike Schwartz
Hi Mo, I have a suggestion: put this at the top of thetcl.lang.Interp.eval() code: if (!(Thread.currentThread().getName().equals("main"))) { throw new TclException( "tcl.lang.Interp.eval() cannot be called from any Java thread other than main." + "Please s

[Tcl Java] Re: [Tcl Java] problem invoking tclBlend calls from within Java threads

2000-07-25 Thread Mo DeJong
On Tue, 25 Jul 2000, Mike Schwartz wrote: > Hi, > > I've come across another problem with tclBlend. ... > Synopsis: if you start up a Java program from Tcl and that Java program > creates multiple threads that try to invoke tcl.lang.Interp.eval() (with > appropriate synchronization so they are