[Tcl Java] Using native TCL in JVM

2000-03-01 Thread Jiang Wu
ead trying to access any of the tcl.lang.* native method will block due to the global monitor. Is this intended? Thanks for your help. -- Jiang Wu [EMAIL PROTECTED] BTW, the good news is that if I compile TclBlend without the synchronization calls, my test Java program is able to load the native

[Tcl Java] UNIX Signals

2000-03-20 Thread Jiang Wu
directories or files. Can there possibly be a conflict in signal handling between TCL and the JVM? -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail to [EMAIL

[Tcl Java] The Mythical TclBlend Patch

2000-04-04 Thread Jiang Wu
allows one to write a Java based shell using native TCL through TclBlend. I will post my modified Jacl shell later this week that you can use to try out the patch. -- Jiang Wu [EMAIL PROTECTED] == TR#4352

[Tcl Java] Patch to the Jacl shell

2000-04-05 Thread Jiang Wu
. Apply the patch to: Shell.java ConsoleEvent.java in the Jacl source distribution. -- Jiang Wu [EMAIL PROTECTED] jaclshell.patch jaclshell.patch

[Tcl Java] RE: [Tcl Java] Re: Thread safety (was: Using JACL in servlets)

2000-05-01 Thread Jiang Wu
. If you have more than one thread, use the event queue. You can also implement the Shell with the file argument using the event loop method by using 2 threads. One runs the event queue, and the other sends "source filename", then sends "exit" to the event queue. -- Jiang Wu

[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Thread question in TclBlend

2000-05-16 Thread Jiang Wu
lining Tcl is thread-enabled or not. This way, there won't be any access to the Tcl interp from any thread other than the "owner" thread. Then there is no need for JAVA_LOCK at all, even for the non-threaded Tcl. What do you think? -- Jiang Wu [EMAIL PROTECTED] -Original Message--

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Thread question in TclBlend

2000-05-18 Thread Jiang Wu
will be OK with requiring threaded Tcl with TclBlend. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Mo DeJong [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 17, 2000 2:25 PM To: Scott Redman Cc: Jiang Wu; [EMAIL PROTECTED] Subject: [Tcl Java] Re: [Tcl Java] RE: [Tcl Java] RE: [Tcl Ja

[Tcl Java] RE: [Tcl Java] Threa d question in TclBlend

2000-05-18 Thread Jiang Wu
how do we protect the non-threaded Tcl interpreter from being accessed by multiple Java threads?" My answer to that is "use the interpreter's event queue", just like you would when using thread enabled Tcl. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Mo DeJong [mailt

[Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jiang Wu
e are some potential threading problems. You also need to patch the existing TclBlend. You may want to take a look at: http://www-cs-students.stanford.edu/~jwu/Using_Tcl_in_Java.html which discuss how to embed Tcl in Java. -- Jiang Wu [EMAIL PROTECTED] -Original Message- F

[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Tcl Blend vs JACL

2000-05-24 Thread Jiang Wu
Here is the patch with the description of the problems solved in the patch. Without the patch, my Java program causes an access violation when loading TclBlend. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Jiang Wu [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 04, 2000 3

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] finalization deadlock under Solaris

2000-06-13 Thread Jiang Wu
I am not sure about how well JDK 1.1.8 work with TclBlend. I have not tested TclBlend with JDK 1.1.8. Are you unable to upgrade to JDK 1.2? -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Dr Wes Munsil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 13, 2000 11:31 AM

[Tcl Java] RE: [Tcl Java] what I now know about the deadlock

2000-06-14 Thread Jiang Wu
of MonitorEnter and MonitorExit from the TclBlend code should not do any harm. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Dr Wes Munsil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 13, 2000 9:50 PM To: [EMAIL PROTECTED] Subject: [Tcl Java] what I now know about the deadlock 2

[Tcl Java] RE: [Tcl Java] New patch for loading of TclBlend from Java

2000-06-15 Thread Jiang Wu
bove problems need to be fixed in order for TclBlend to pass most of the Tcl regression tests. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Mo DeJong [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 15, 2000 6:45 AM To: [EMAIL PROTECTED] Subject: [Tcl Java] New patch for loading

[Tcl Java] A Tcl or TclBlend problem?

2000-06-23 Thread Jiang Wu
representation. Then, given the string representation, a valid C object can be found. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail to [EMAIL PROTECTED]

[Tcl Java] RE: [Tcl Java] A Tcl or TclBlend problem?

2000-06-23 Thread Jiang Wu
-Original Message- From: Mo DeJong [mailto:[EMAIL PROTECTED]] Sent: Friday, June 23, 2000 3:15 PM To: Jiang Wu Cc: [EMAIL PROTECTED] Subject: Re: [Tcl Java] A Tcl or TclBlend problem? You mentioned that doing an after with a list object solved the problem, but here you

[Tcl Java] preserve/release or use GC

2000-06-26 Thread Jiang Wu
} } // end of CObject Any comments? -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail to [EMAIL PROTECTED] with the word SUBSCRIBE as t

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] preserve/release or use GC

2000-06-27 Thread Jiang Wu
TclObject. TclString can be safely GC'ed because it has no link to any Tcl C data structures. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail to [EMAIL PRO

[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Re: [Tcl Java] preserve/release or use GC

2000-06-27 Thread Jiang Wu
There are also problems with the returned TclObject from "getVar", "setVar", "getResult" of the Interp class. Those TclObjects usually contains CObject as the internal rep. But TclList is by far the most difficult to deal with. -- Jiang Wu [EMAIL PROT

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] A Tcl or TclBlend problem?

2000-06-28 Thread Jiang Wu
is just a string only representation of what I passed in. I had to write my workaround using a string-object mapping scheme like the ones used in ReflectObject, but without the reference counting. -- Jiang Wu [EMAIL PROTECTED] Th

[Tcl Java] RE: [Tcl Java] RE: [Tcl Java] RE: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] A Tcl or TclBlend pr oblem?

2000-06-29 Thread Jiang Wu
bject and lock it as an atomic operation in Tcl? set x [java::new -lock String foo] Otherwise, it may not work. set x [java::new String foo] java::lock $x -- may or may not work -- Jiang Wu [EMAIL PROTECTED]

[Tcl Java] RE: [Tcl Java] tclBlend / tcl thread workaround

2000-07-18 Thread Jiang Wu
B to finish in the JVM. The code deadlocks. When sharing a long running piece of code, other forms of synchronization work better such as locks and message passing. Tcl provides message passing as the way to communicate between Tcl interpreter threads. -- Jiang Wu [EMAIL PROTECTED

[Tcl Java] RE: [Tcl Java] Re: [Tcl Java] RE: [Tcl Java] tclBlend / tcl thread workaround

2000-07-18 Thread Jiang Wu
Oops. I am sorry about my earlier email. I didn't realize the email program was using the html formatting for the reply. I will be more careful from now on. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Mo DeJong [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 18, 2000

[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
, and 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 tclBlend calls from within

[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
Tcl/Blend is thread-safe as a functional area even though most of its methods are not thread safe. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail

[Tcl Java] RE: tcl Blend and Java threads...

2000-07-26 Thread Jiang Wu
It should work. What is the JVM environment you are using? Is it 1.2, native thread? -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Mike Schwartz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 25, 2000 9:52 PM To: Jiang Wu; Mo DeJong Cc: [EMAIL PROTECTED] Subject: tcl

[Tcl Java] RE: tcl Blend and Java threads...

2000-07-26 Thread Jiang Wu
Wu [EMAIL PROTECTED] -Original Message- From: Mike Schwartz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 26, 2000 10:56 AM To: Jiang Wu Cc: Mo DeJong; [EMAIL PROTECTED] Subject: RE: tcl Blend and Java threads... Here's what I get from running java -version: java

[Tcl Java] Fixing TclBlend GC Deadlock

2000-07-30 Thread Jiang Wu
created. The thread continues on doing other work without using the event queue of 'interp'. How do we get this thread to free objects on the "free list"? -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing li

[Tcl Java] Re: Problem Loading TclBlend

2000-08-01 Thread Jiang Wu
I don't see the PATH to your Tcl dll. Open a DOS prompt, then type: dumpbin -imports C:/Program Files/Tcl/lib/tclblend/tclblend.dll For each dependent dll, make sure that you can find it on your path. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Dan Schenck

[Tcl Java] TclBlend Patch 8/5

2000-08-06 Thread Jiang Wu
outlined the various initialization paths the TclBlend can go through and how the mutex protects these situations in the following document, item 3 and 4. Your comments and questions are welcome. http://www-cs-students.stanford.edu/~jwu/blendchanges.txt -- Jiang Wu [EMAIL PROTECTED]

[Tcl Java] TclBlend Makefile.in patch

2000-08-06 Thread Jiang Wu
Since I don't have an UNIX machine to test this, I am sending this patch separately. -- Jiang Wu [EMAIL PROTECTED] Index: Makefile.in === RCS file: /cvsroot/tcljava/Makefile.in,v retrieving revision 1.14 diff -u -r1.14 Makefil

[Tcl Java] Re: JavaGetEnv + Threads = mo going insane

2000-08-07 Thread Jiang Wu
e placed around 3 in Interp_init. After initialization, only 2 is used. 2 does not require synchronization after initialization. -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you by the Stanf

[Tcl Java] Re: TclBlend Patch 8/5

2000-08-07 Thread Jiang Wu
commands used to produce the problem? % source ... the Tcl script part of your source code ... % set x 1 % after 2 {set x 2} % vwait x -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you by the Stanford Alumni Association and Critical

[Tcl Java] Re: TclBlend Patch 8/5

2000-08-07 Thread Jiang Wu
, if you do: % after 1000 {puts hello} What should happen after 1 second? -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe:send mail to [EMAIL PROTECTED

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-07 Thread Jiang Wu
about "reading only 1 byte at a time to avoid some race condition". Your insights into these matter are greatly appreciated. -- Jiang Wu [EMAIL PROTECTED] From: Scott Stanton [EMAIL PROTECTED] Date: Mon, 07 Aug 2000 11:07:26 -0700 To: Jiang Wu [EMAIL PROTECTED] Cc: Mo DeJ

[Tcl Java] Unidentified subject!

2000-08-08 Thread Jiang Wu
to 0 6. do not pass Tcl_Obj to other threads, this is not supported by Tcl anyway With this fix, I dont' think there is a need to make the GC free Tcl_Obj. -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you by the Stanfor

[Tcl Java] TclBlend Ref Counting Bug (GC related)

2000-08-08 Thread Jiang Wu
do nothing regarding to the native Tcl_Obj 5. put an assert into the TclObject.finalize() to catch cases when the reference count is not decremented to 0 6. do not pass Tcl_Obj to other threads, this is not supported by Tcl anyway With this fix, I dont' think there is a need to make the GC free T

[Tcl Java] Re: Possible patch: JavaGetEnv + threads

2000-08-08 Thread Jiang Wu
On Tue, 08 August 2000, Mo DeJong wrote: Ok, I fixed that. Besides that, do you like the reorg? It looks good to me. Let's commit it to the branch. -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you by the Stanford Alumni

[Tcl Java] Re: TclBlend Patch 8/5

2000-08-08 Thread Jiang Wu
This is the desired result because the thread sleeps 1 second, then posts an event, then repeats. The vwait event waits for 10 seconds. So the thread can post a maximum of 9 events during this 10 seconds. Is this what you get also? -- Jiang Wu [EMAIL PROTECTED

[Tcl Java] Re: TclBlend Patch 8/5

2000-08-08 Thread Jiang Wu
with all sort of asynchronous Tcl scripts without any problems. -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you by the Stanford Alumni Association and Critical Path

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-08 Thread Jiang Wu
bad about using "errno" from multiple threads? Another strange thing if I run the same Java program on a smaller example, then it seems to work OK. When the error does happen, there are many threads in the process. -- Jiang Wu [EMAIL PROTECTED] ---

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-08 Thread Jiang Wu
em globals. -- Jiang Wu [EMAIL PROTECTED] 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:

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-08 Thread Jiang Wu
Tcl can interact badly with Java, so can these Tcl extensions that are not thread enabled. If that is the case, even if we can make Tcl work with the JVM, there is no guarantee that the extensions can work. -- Jiang Wu [EMAIL PROTECTED] From: Mo DeJong [EMAIL PROTECTED] Date: Tue, 8 Aug 2000

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-09 Thread Jiang Wu
-DTCL_THREADS) to compile a non-threaded Tcl. The Solaris problem did go away using this special Tcl compilation. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sponsored by Scriptics Corporation. To subscribe

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-09 Thread Jiang Wu
and use so that they can focus on developing solutions using the tools rather than worrying about compiling the tools. But I guess that is as much a wishful thinking as hoping that the extensions will be fixed to be thread-safe. -- Jiang Wu [EMAIL

[Tcl Java] Re: TclBlend Initialization Mutex

2000-08-09 Thread Jiang Wu
a lot to the product. Maybe a company can provide binary distribution service and charge $99 per copy to cover the cost of the testing, follow the commercial Linux model. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list is sp

[Tcl Java] ReflectObject

2000-08-22 Thread Jiang Wu
, or a limitation? -- Jiang Wu [EMAIL PROTECTED] 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

[Tcl Java] xputil bug with patch

2000-09-22 Thread Jiang Wu
xputil does not properly handle Windows environment variables. It interprets the "\" path separator and ";" that is to distinguish multiple paths in Windows environment as Tcl significant. Here is the patch: Index: xputils.tcl

[Tcl Java] ReflectObject bug and patch

2000-09-22 Thread Jiang Wu
In TclBlend 1.2.6, when a ReflectObject is created to represent a TclObject, the ReflectObject does not preserve() the TclObject. But the ReflectObject holds on to the TclObject for a long duration in its hash table. When the TclObject is dereferenced, it can cause the ReflectObject to contain

[Tcl Java] Re: merge with aolserver

2000-10-06 Thread Jiang Wu
code in /win/winNotifier.c and /unix/unixNotifier.c -- Jiang Wu [EMAIL PROTECTED] On Thu, 05 October 2000, Dan Wickstrom wrote: I recently merged the code from the ajuba-contract branch with nsjava/aolserver and it seems to be work pretty well on linux. Operation on solaris machines

[Tcl Java] Re: merge with aolserver

2000-10-09 Thread Jiang Wu
. But with this fix, it makes life much easier to write Tcl commands in Java. -- Jiang Wu [EMAIL PROTECTED] -Original Message- From: Daniel Wickstrom [mailto:[EMAIL PROTECTED]] Sent: Monday, October 09, 2000 6:51 AM To: [EMAIL PROTECTED] Subject: [Tcl Java] Re: merge with aolserver

[Tcl Java] Re: merge with aolserver

2000-10-10 Thread Jiang Wu
I ran your test on my version of the fix. I don't see any crash. One difference in my code is that I didn't remove any of the reference counting code that was in the C part of TclBlend. I.e. when a Tcl_Obj is created to wrap a TclObject, it adds a ref count. Theoretically, this is not needed

[Tcl Java] Fwd: TclBlend Ref Counting Bug (GC related)

2000-10-13 Thread Jiang Wu
subject of "GC". -- Jiang Wu [EMAIL PROTECTED] --- Start of forwarded message --- Subject: TclBlend Ref Counting Bug (GC related) To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] From: Jiang Wu [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Date: 08 Aug 2000 00:12:48 PDT

[Tcl Java] Re: Fwd: TclBlend Ref Counting Bug (GC related)

2000-10-13 Thread Jiang Wu
attempts to use the pointer to the free'ed Tcl_Obj (2), which can cause a segmentation fault. There may be other places in TclJava, where the above type of thing happen. -- Jiang Wu [EMAIL PROTECTED] -- [EMAIL PROTECTED] is brought to you

[Tcl Java] Re: possible memory.

2000-10-24 Thread Jiang Wu
the interp, goes back into the thread pool. The thread itself is never deleted, only the resources used by the thread. TclBlend allows a Tcl program to use Java. It also needs to work the other direction, which is allowing a Java program to use Tcl. -- Jiang Wu [EMAIL PROTECTED

[Tcl Java] TclObject problem

2000-10-24 Thread Jiang Wu
| V C Tcl_List internal rep (F) If this were the case, then there would be no memory loss. -- Jiang Wu [EMAIL PROTECTED] The TclJava mailing list