[ 
http://issues.apache.org/jira/browse/TUSCANY-959?page=comments#action_12456944 
] 
            
Geoff Winn commented on TUSCANY-959:
------------------------------------

There is a discussion of this issue on the Tuscany mailing list here

http://mail.google.com/mail/?auth=DQAAAIQAAAB50jIqqM55gBBXS-jkgxW07VOS8vAq-vaWS-eLB93Iy03LYj8xMvP8uiGunLgJbRPxHywmRQRibZVZdD-m30APzH0te4Qn_RkqCRGUwGr9yLt7nRwYWDhDSNuBhF2mO0FkRuMXFAOOxkLwOyixb9SCZSYRyCueZUZ1ckzusKlMCfgAPfhvnGlA1rp1Tn7uxQU

Clearly the amount of work required to make SDO truly thread safe is 
prohibitive at this time, however, we can make it thread tolerant by linking 
with multi-threaded libraries and eliminating calls that are known to violate 
thread safety. As best I can tell we need to do the following (at least)

1. localtime will have to be replaced with the hread safe equivalent on each 
platform. This is localtime_r on Unix and (probably) localtime_s on Windows.

2. The Windows buoild already specifies multi-threaded libraries in its link 
step (/MD or /MDd), but this should be checked to ensure that we haven't 
overlooked anything.

3. The Linux build will need to be modified to link against thread safe 
libraries. It isn't obvious whether this should be a build time option or we 
simply switch to using threaded libraries unconditionally. This question should 
be resolved by discussion on the mailing list.

4. SDO depends on libxml2 (http://xmlsoft.org/) and that requires an 
initialisation routine to be run if it is used in a multi-threaded 
environement. The requirement is described here http://xmlsoft.org/threads.html

5. SDO also depends on both zlib and iconv. Both these will need to be checked 
in case they too have requirements to run in a multi-threaded environment.

The behaviour we are looking for is best described as "thread tolerant" rather 
than thread-safe. We want to be in a position where SDO will work for multiple 
threads running in parallel _on condition that_ if a thread creates an SDO 
artifact (data factory, data object, whatever) then the only thread that will 
ever interact with that artifact is the one that created it.

> 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
>
> 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]

Reply via email to