On 03/29/10 15:59, Frank Schoenheit, Sun Microsystems Germany wrote:
I'm writing an extension in C++. The extension uses global variables, but doesn't create threads. Since OpenOffice.org is multithreaded, can race conditions and other threading problems occur with my global variables ?
Yes, your C++ implementation should be written in such a way that the interface methods of the UNO API it implements can be called by arbitrary threads, in arbitrary patterns.

Using the ":affine" suffix in component_getImplementationEnvironment
(see
http://hg.services.openoffice.org/DEV300/file/f387649cb501/connectivity/source/drivers/ado/Aservices.cxx#l121
for an example) should ensure that the UNO runtime takes care of this,
right?

That would be the ":unsafe" thing (which is weaker than ":affine," if I understand correctly), right? Kai Ramme should know...

-Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to