We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Is Document.Clone thread safe

I have some code which loads a Document from a file, starts some threads where each thread gets a handle to the Document and in a loop clones the document for a number of recipients, performs a mail merge and saves it to a pdf. The problem is that I’m sometimes getting various exceptions which look like threading issues. The only thing shared between the threads is the Document and the only method called on the document in threads is Clone. I would expect Clone to be a read-only operation which doesn’t require synchronization but is that not the case?

Hi Andreas,

Thanks for your inquiry. Sure, Aspose.Words component does support multi-threading; the only thing you need to make sure is that you always use separate Document instances per each thread. One thread should use one Document object. Secondly, could you please create a simple application (for example a Console Application Project) that helps me reproduce the same problem on my side and attach it here for testing? I will investigate the issue on my side and provide you more information.

Best regards,