On Sep 15, 2006, at 12:09 PM, Caleb Richardson wrote:

> I have quite a large number of JSPs to precompile, and these JSPs  
> share
> many interdependent tag files. I am currently programatically invoking
> the JSPCompiler.main() method, my question is whether or not it is  
> safe
> 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? 
id=1352

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  
> with
> 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  
> optimization
> on SMP machines by checking Runtime.getAvailableProcessors (or  
> checking
> via some other technique)?

Not yet.  It would be worth looking into.

-- Scott

>
> Thanks for any help,
>
> Caleb Richardson
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to