cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ugo Cei <>
Subject Re: Why is FlowInterpreter SingleThreaded?
Date Tue, 21 Oct 2003 07:03:09 GMT
Sylvain Wallez wrote:
> After looking carefully, the interpreter must be SingleThreaded, even if 
> thread safe...
> This is because although an intepreter can handle concurrent requests, 
> each sitemap must have a different instance, since the interpreter holds 
> the scripts defined in a <map:flow> statement.
> So if the interpreter is made ThreadSafe, a unique instance will exist 
> for the whole system, and will mix all script definitions and script 
> global variables. Making it SingleThreaded ensures each sitemap will 
> have its own instance. It seems hacky, but I don't see what other means 
> we have to achieve this...

Well, it depends. Personally, I never used subsitemaps to host different 
applications inside the same Cocoon instance. It's much more trouble 
than it's worth, IMHO. You have one WEB-INF, one cocoon.xconf and it's 
too easy for one application to step onto the toes of all the others.

OTOH, I do use subsitemaps to logically partition my applications in 
several modules, as soon as the sitemap grows beyond a handful of 
matchers. But in that case, it seems logical for subsitemaps to share 
scripts and global variables (like, for instance, a handle to the user's 
identity after authentication, otherwise you'd end up authenticating 
once for each subsitemap).

In the end, maybe it would be useful to be able to specify the kind of 
interpreter you really want, using something like:

<map:flow language="javascript" shared="yes|no">

But I really don't know how hard this would be.


Ugo Cei - Consorzio di Bioingegneria e Informatica Medica
P.le Volontari del Sangue, 2 - 27100 Pavia - Italy
Phone: +39.0382.525100 - E-mail:

View raw message