On Tue, 25 Jul 2000, Marc Saegesser wrote:
> I just noticed in Jiang Wu's excellent "Embedding a Tcl Interpretter in
> Java" article
> (http://www-cs-students.stanford.edu/~jwu/Using_Tcl_in_Java.html) the
> following paragraph in the "Other Issues" section:
>
> >>TclBlend 1.2 does not support multiple Tcl interpreters in a
> >>Java program. Do not try to create multiple "tcl.lang.Interp"
> >>instances. Future version of TclBlend may support multiple Tcl
> >>interpreters in multiple threads. In TclBlend, it is safe to create
> >>slave interpreters within the master interpreter as one could in any
> >>single threaded Tcl program.
>
> Is this still the case? I had hoped to create a pool of threads, each
> running a separate Tcl interpreter. A pool manager class would manage this
> collection of interpreters to create new ones when the pool gets low,
> harvest idle ones when the pool gets large. All of these threads would be
> running inside a single JVM inside a servlet engine. In response to HTTP
> requests, servlets could request an idle interpetter from the pool and ask
> it to run a script. There may be several scripts active any given time and
> the scripts may block for relatively long periods. There is no need for
> scripts executing in separate interpretters to communicate or even know
> about each other.
The current Tcl Blend code does not work with multiple Tcl threads.
There is a plan in place to remedy this situation, but we
will not be able to post the details until the end of the week.
> If the paragraph quoted above still applies, then it looks like this
> approach won't work. What if I switched to the Jacl intead of TclBlend?
> Could I use Jacl to create mulitple Tcl interpretters on separate threads
> inside a single JVM?
You can always prototype the system in Jacl and move to Tcl Blend
when the thread work is finished. Jacl does threads a lot better
than Tcl Blend, at least for now. You should not have to rewrite
anything, both Jacl and Tcl Blend support the same Tcl/Java API.
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