Making an XML data driver multithread safe
To make an XML data driver multithread safe, you must wrap it in an instance of IlrXmlSynchronizer.
About this task
An IlrXmlDefaultDataDriver instance is multithread safe only if wrapped by an instance of IlrXmlSynchronizer. The synchronization might also include the XOM by using the class IlrXmlSynchronizer.IlrXmlDataDriver.
Procedure
To make the XML data driver multithread safe:
The following code extract demonstrates how to use the IlrXmlSynchronizer class:
IlrXmlDataDriver stdDriver = new IlrXmlDefaultDataDriver();
IlrXmlDataDriver syncDriver = new IlrXmlSynchronizer ( stdDriver, true );
// The syncDriver is now multithead safe.
syncDriver.loadModel ( ... );
Setting this parameter ensures that the XOM and the data driver are multithread safe during all data driver operations. If the XOM is not synchronized in this manner, mapping operations involving access to the XOM are not multithread safe.
The driver is multithread safe for these mapping operations if the XOM is accessed independently from the XML driver.