This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Embedding kawa in a multi-threaded servlet environment (a fewquestions).
- From: Per Bothner <per at bothner dot com>
- To: Eric Merritt <cyberlync at yahoo dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Tue, 30 Dec 2003 14:10:48 -0800
- Subject: Re: Embedding kawa in a multi-threaded servlet environment (a fewquestions).
- References: <20031230202740.40064.qmail@web40808.mail.yahoo.com>
Eric Merritt wrote:
Not allot of information but there is one guy there
claiming that kawa is very thread *unsafe*
Yes, I just noticed this claim. It's rather obnoxious
that he isn't more specific. It's like saying Java isn't
thread-safe - it all depends on how you use it.
Some of the classes (such as Symbol and Environment)
probably could use some extra synchronization, though
this is less likely to be an issue for compiled code.
I don't believe there is anything "incurably thread-unsafe".
Also what is the correct way to create an interpreter
and environment in a safe manner. I have glanced at
some examples that are included in the source to get
an idea and it looks like its done in different ways
in each example I have seen. All I need to do is
create an environment, make some java objects
available to the script and then kick off the script
by name. I would prefer that the compiled version of
the script be stored and used unless it changes, but I
have not quite figured out how to go about that yet.
You might want to look at KawaPageServlet. This automatically
recompiles a script when it changes. There is an example
at http://www.gnu.org/software/qexo/simple-xquery-webapp.html
that describes an XQuery "application", but KawaPageServlet
should work just as well with Scheme.
--
--Per Bothner
per@bothner.com http://per.bothner.com/