none
Office Converter DLLs and thread safety RRS feed

  • Question

  • Hi all,

    We have this tool (C++ Win32) that runs through a directory hierarchy performing all kinds of stuff on the files found there. We use the Office Converter DLLs (*.cnv found under HKLM/../Shared Tools/Text Converters/Import) for converting between formats, and all has been working well for years and years.

    However, we just invested in a couple of multi-processor workstations, and I thought I might give multi-threading a try. And this is where I got stuck. I get all kinds of sharing violations and error messages when calling the exported functions of the DLLs (ForeignToRtf32 and so on), even if I load the DLLs inside the threads. Before investigating this further, are the converter libs even intended to be used in a multi-threaded environment in this manner?

    Thankful for any pointers :-)

    Thursday, April 21, 2011 12:44 PM

Answers

  • I don't think the library is thread safe or fit to multi-threading scenario.  Why do you want to use them in multi-threading sceanrio? 
    • Marked as answer by Marfuas Monday, May 2, 2011 12:20 PM
    Friday, April 29, 2011 2:04 AM
  • Hi Pam Pam,

    No, I don't think that the libraries are thread-safe either. Tried just about everything I could come up with, but couldn't solve the problem -- the call to ForeignToRtf32 crashes somewhere inside the converters if called from several threads at the same time. However, if that single call is protected by a mutex, everything works fine. So unless someone with inside info on this says differently, I will assume that they are not designed to be used in this way.

     

    Regards,

    /M

     

    • Marked as answer by Marfuas Monday, May 2, 2011 12:20 PM
    Monday, May 2, 2011 12:19 PM

All replies

  • I don't think the library is thread safe or fit to multi-threading scenario.  Why do you want to use them in multi-threading sceanrio? 
    • Marked as answer by Marfuas Monday, May 2, 2011 12:20 PM
    Friday, April 29, 2011 2:04 AM
  • Hi Pam Pam,

    No, I don't think that the libraries are thread-safe either. Tried just about everything I could come up with, but couldn't solve the problem -- the call to ForeignToRtf32 crashes somewhere inside the converters if called from several threads at the same time. However, if that single call is protected by a mutex, everything works fine. So unless someone with inside info on this says differently, I will assume that they are not designed to be used in this way.

     

    Regards,

    /M

     

    • Marked as answer by Marfuas Monday, May 2, 2011 12:20 PM
    Monday, May 2, 2011 12:19 PM