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

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



On Wed, Feb 20, 2008 at 03:04:42PM +0200, Andrew W. Nosenko wrote:
> On Feb 20, 2008 2:50 PM, Daniel Veillard <veillard redhat com> wrote:
> > >    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.
> 
> Sorry, but (IMO) there indded may be a problem if defferent concurent
> threads running on the different CPUs.

  The only thing we need is that when different input are created for 
*the same* parser context they get different ids (understanding the 
parser test will help you verify this assertion). Only one thread can 
use a given parser context at a time (that's a requirement of libxml2
thread usage http://xmlsoft.org/threads.html). I state this code fullfils
the requirement, but please show me the sequence of event leading to your
problem. At worse 2 threads take the same initial value, get the same
id but since they have to operate on different parser contexts this
is absolutely not a problem.

  So tell me how do you get your problem ?

Note, the probability of other threads allocating 4 billions inputs
in the meantime is IMHO neglectible and would not be solved by a
critical section.

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]