Re: [xml] libxml and threads




On Feb 23, 2005, at 12:41 PM, Daniel Veillard wrote:

On Wed, Feb 23, 2005 at 12:26:32PM +0100, Massimo Cafaro wrote:
May be there is a little misunderstanding here.
I said in my first email that it is entirely my fault the problem I am
experiencing because I am new to the use of libxml2.
I did not say that libxml2 code leaks memory. I want to make clear
again that its is my responsibility, not yours.

As I said, since that specific part of the code use malloc()
directly and not the wrappers, it is possible to have a leak there
that went unnoticed, though it is unlikely. Hence my request for
a reproduceable test case in case you still get the problem after
following the suggestions.


I will do, in case (but it probably wonn't be necessary, I really hope to fix the problem).

I can only say thanks for your suggestions. Unfortunately I did not
find a detailed documentation on the web site. This is actually a pity

That is not normal, really, if you go to the web site:
http://xmlsoft.org/
in the left menu, the link in bold "Developer Menu" should really
raise your attention, then once there
http://xmlsoft.org/docs.html
the item "Thread safety" should really be obvious too
http://xmlsoft.org/threads.html
and you get to the page with the advices

Do you remember what step you missed to get there ?

Yes, I went immediately to the reference manual, and from here to threads. Then I could only find the thread related APIs, but no related advice.

since I firmly believe that libxml2 is a great achievement, but its
complexity makes it difficult to use it correctly ( I have been
developing unix apps for almost 20 years, including of course threaded
apps, so I now exactly what kind of problems can occur).

So you should not be surprized that a library which maintains state
need to have a initialization routine called in the main thread before
further processing.

Indeed I thought that this was xmlInitThreads() which did not work.

Cheers,
Massimo

--

*************************************************************************************

Massimo Cafaro, Ph.D. Center for Advanced Computational Technologies
Assistant Professor Voice +39 0832 297371
University of Lecce, Italy Fax +39 0832 297279
Faculty of Engineering E-mail massimo cafaro unile it
Via per Monteroni cafaro cacr caltech edu
73100 Lecce, Italy Web http://sara.unile.it/~cafaro

*************************************************************************************

Attachment: PGP.sig
Description: This is a digitally signed message part



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