This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Kawa fails if used in multithreading


Per Bothner wrote:
On 08/07/2010 01:35 AM, Per Bothner wrote:
If so, I'll check the change in tomorrow.

I checked in the fix.

Tested and works very well. Thanks for the fix.



Of course you also want to consider why you're doing 'eval'
so many times - unless it is just for testing.  You'd want
to avoid compiling the same code many times, since that
may be expensive.  One alternative is to eval an expression that
evaluates to a procedure, which you can save and call many  times.

If you're writing web server code, consider using the
"KawaAutoHandler" mechanism, which automatically uses
compiles and re-uses a "script":
http://www.gnu.org/software/kawa/Self-configuring-page-scripts.html

My web service have to evaluate, given a set of inputs, a lot of different Scheme scripts to compare the resulting outputs. Actually we store the scripts into a database; on each request we bind some beans to an Environment and then "eval()" all them. As an optimization we would keep into the database also the compiled version of each script, and load it instead of re-compiling the source code if already in sync. But reading your documentation, I've found this sentence:


"There is an unsupported option to write the compiled file to a class file, but there is no support to use previously-compiled classes."

Does this means that I can't serialize the compiled Scheme program to database?


> If this doesn't work right, I want to fix it!


Nice to know it ;)


Daniele



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]