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
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
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
.
Apply the patch to:
Shell.java
ConsoleEvent.java
in the Jacl source distribution.
-- Jiang Wu
[EMAIL PROTECTED]
jaclshell.patch
jaclshell.patch
. 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
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--
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
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
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
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
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
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
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
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]
-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
}
} // 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
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
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
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
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]
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
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
, 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/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
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
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
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
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
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]
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
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
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
, 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
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
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
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
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
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
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
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]
---
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 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
-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
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
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
, 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
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
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
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
. 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
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
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
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
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
|
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
55 matches
Mail list logo