Re: [xslt] Re-use of parsed stylesheet

On Thu, May 17, 2001 at 03:37:14PM +0800, William M. Brack wrote:
> >   Okay i fixed this in CVS. Basically global variables are now
> > only read from the stylesheet and copied/evaluated within a hash table
> > in the transformatio context.
> Excellent, and in perfect time for our current work implementing a
> multi-threading
> "transformation server".  Can we now assume that both the xsltStylesheetPtr
> returned
> by xsltParseStylesheetFile and the xmlDocPtr returned by xmlParseFile are
> structures
> which are "thread-safe" (i.e. do not need to be protected against
> interaction between
> different threads using them)?

  Hum .. In the absolute no :-\, I know one possible remaining problem:
    the templates CompMatch are part of the stylesheet structures.
    And for the steps testing I keep a cache of the previous element
    used to test against (this is absolutely necessary to have good
    performances when using template tests with predicate on possibly
    large lists of siblings).

  The test and set at this level is far from atomic, it seems hard
to check or change to be made completely thread safe. So again the only
solution seems to copy the template pattern information pool at the
evaluation context level from the staylesheet at startup ... This sounds
nasty because I don't know how much extra data will need to be pulled.

  Well if you have some cycles to look at this that would be great this
need a bit more analysis and a possibly non-trivial change.


Daniel Veillard      | Red Hat Network  | libxml Gnome XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]