When Tuscany is being used as a library under Apache and PHP or similar,
libxml will already have been initialized, so please make this a compiler
option to avoid xmlInitParser being called more than once.

On 15/12/06, Geoff Winn (JIRA) <tuscany-dev@ws.apache.org> wrote:

    [
http://issues.apache.org/jira/browse/TUSCANY-959?page=comments#action_12458823]

Geoff Winn commented on TUSCANY-959:
------------------------------------

Item 4 is harder than I first thought.

On Linux we can ensure that the initialisation routine is called exactly
once by using pthread_once. However, Windows has no direct equivalent to
that and we have to use the dllmain functionality instead to ensure that
the xmlInitParser is called exactly once and before any thread uses
SDO. I'm looking into this at the moment.

We cannot use static initialisation because in general there is no way to
know when such a variable will be initialised. For example, it is possible
the initialisation will be attempted on a thread that then gets pre-empted
by a second, and that thread executes a libxml2 operation before the
initialisation has completed.

I'll update this JIRA when I have more information.

> Please use thread-safe libraries
> --------------------------------
>
>                 Key: TUSCANY-959
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-959
>             Project: Tuscany
>          Issue Type: Improvement
>          Components: C++ SDO
>    Affects Versions: Cpp-current
>            Reporter: Caroline Maynard
>            Priority: Minor
>         Attachments: SAX2Parser.959
>
>
> One of our SDO for PHP users is planning to run in a multi-threaded web
server.
> They have run an evaluation tool and only found one thread-safety issue
- the use of  localtime() rather than localtime_r()  in
commonj/sdo/SDODate.cpp.
> Please would you modify this call accordingly? It's fine for this to be
a conditional compile if you prefer.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Caroline

Reply via email to