On Sep 15, 2006, at 12:09 PM, Caleb Richardson wrote:
> I have quite a large number of JSPs to precompile, and these JSPs
> many interdependent tag files. I am currently programatically invoking
> the JSPCompiler.main() method, my question is whether or not it is
> to fork multiple threads that in turn call JSPCompiler.main(), each
> thread handling a subset of the JSPs.
I'm adding a bug report for this: http://bugs.caucho.com/view.php?
Currently, the locking is coarse-grained for the JSP compilation, so
it may just force a single compilation at a time. One of the issues
is that the complation is used for things like *.java compilation in
WEB-INF/classes. And since javac might decide to compile shared
dependencies, you might have multiple threads compiling the same
dependent file at the same time. (The issue is resolvable, but would
require more sophistated locking than we've got right now.)
> Presumably JSPCompiler uses the same internal code as on demand JSP
> compilation post deployment, so I would expect it to be thread safe
> regard to only compiling a given tag file once, even if it is shared
> among many JSPs.
> So is this safe, and does JSPCompiler already perform this
> on SMP machines by checking Runtime.getAvailableProcessors (or
> via some other technique)?
Not yet. It would be worth looking into.
> Thanks for any help,
> Caleb Richardson
> resin-interest mailing list
resin-interest mailing list