[xsd-users] Thread Safety

Boris Kolpackov boris at codesynthesis.com
Thu Jan 4 15:25:51 EST 2007


Hi Doug,

[I only noticed your mailing list post after I have replied
 to your private email. I am posting the same reply to
 xsd-users for others who could be interested.]


Doug Kunzman <doug.kunzman at sensor.com> writes:

> I was wondering if XSD is thread safe?

XSD is thread-safe in the sense that you can use different
instantiations of the generated classes in several threads
simultaneously. This is possible due to the generated code
not relying on any global variables[1].

If you need to share the same object between several threads
then you will need to provide some form of synchronization.
You can use the generated code customization mechanisms to
embed the synchronization primitives into the generated
classes.


[1] When you generate polymorphism-aware code, there are
    global type maps being generated. They are thread-safe
    since they are initialized during program startup and
    are read-only after that.

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070104/8ef16386/attachment.pgp


More information about the xsd-users mailing list