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:

   Hi,

    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
   fact.

  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. 

Daniel


-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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