The original thinking was driven by the same concern. We couldn't know which
platforms it might end up on, which could be anything from a small embedded
device up to an MVS mainframe, so we didn't want to make any assumptions in
terms of initialization. And we didn't want to assume that just because it
was linked in that it would always be run on every invocation of the
containing application or library.

-------------------------------------
Dean Roddey
Chairman/CTO, Charmed Quark Systems
[EMAIL PROTECTED]
www.charmedquark.com
 


-----Original Message-----
From: Brandon White [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 11:29 AM
To: [email protected]
Subject: RE: Protect XMLPlatformUtils::Initialize and
XMLPlatformUtils::Terminate


Doing it like this is the only safe way to guarantee that Init/Term are
thread-safe though because we know that the static mutex instance will be
initialized before any calls can be made into the library. And honestly, if
the static global mutex object fails to initialize a synchronization
primitive (pthreads on UNIX, InitializeCriticalSection on Windows, etc..),
then don't you have _much_bigger_ problems to deal with? 

Disclaimer: I have no familiarity with platforms other than some UNIX/ish
platforms (linux, solaris, aix, hp-ux) and Windows, and I'm not sure how
many platforms Xerces supports, so perhaps for certain platforms, you simply
can't do it this way because of OS limitations. But my naive opinion of
those platforms that can't provide such guarantees would be that they're
inherently broken :). 

Thanks,
Brandon

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: May 18, 2005 9:56 PM
To: [email protected]
Subject: Re: Protect XMLPlatformUtils::Initialize and
XMLPlatformUtils::Terminate





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

Reply via email to