Re: [xml] register i/o callback functionality



Rob Richards wrote:
From: Mike Hommey


One other issue I thought about is all the global variables. It is not
really a problem with apache 1.3 (provided that modules don't set them
in their initialization, but rather in the request loop), but definitely
might be with apache 2.0 with the threaded "engine".


This is actually not that big of a problem. It was a god send when thread
safety was added for most of the global stuff and thread support made
default during the build. As the stuff i work on needs to support multiple
OS and web servers, I typically use IIS and isapi to test the threading
issues (since IIS isnt consistant with its startup and shutdown thread it
makes it a good worst case scenario I find).

On that note, a big kudos to all those who worked on the thread support - it
sure made my life a hell of a lot easier :)

Well, let's take a simple case :
One module wants to format output with indentation.
Another wants to format output without.
So, the first sets xmlIndentTreeOutput to 1, and then calls xmlDumpFormatMemory. The second sets xmlIndentTreeOutput to 0, and then calls xmlDumpFormatMemory. When the two of them are not called "simulteanously", this is not a problem. But now imagine this multithreaded scenario :
second module sets xmlIndentTreeOutput to 0
first module sets xmlIndentTreeOuput to 1
first module outputs
second module outputs
Well, it seems to me that the second module has made an indented output while not expected to... Yes, we could use thread locks, but the whole is quite a long procedure to be put in "critical section"... Note that the xmlsave module might help changing that (by the way, is there any plan for a xmlsave version of Dump*Memory functions ? xmlsave seems to be very file oriented...), but for now, it still is a problem...

Mike



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