Re: [xml] Query Regarding Revision 2121 in SVN for entity nesting check in parserinternal.c

On Wed, Feb 20, 2008 at 05:32:47PM +0530, Ashwin wrote:


    I   have   a   doubt   regarding   the   revision   2121  in  SVN  in
   parserInternals.c,  a  check  for entities nesting has been added. For
   the following statement,(in function xmlNewInputStream)

   input->id = id++;

   where  id  is a static variable thread safety is not taken care of. Is
   this  because there can be only one parser context irrespective of the
   number  of  threads?  I think the comment above the code mentions this

  No the comment is about the fact that only one thread is allowed to
use a given parser context. If you didn't then the application had broken the
libxml2 API rules.

   However  I assume in case of scenarios where there is a parser context
   per thread, thread-safety is required, right?

  No. try to understand how the added check works.
The point is make sure that for a given parsing context you always get 
different ids when you create new input streams. That code does it,
and the comment is right. 


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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