No, you aren't missing anything. Win32::OLE is not compatible with the Perl 5.8 threading model.

There are several issues that need to be solved:

Whenever Perl creates a new thread, Win32::OLE needs to be informed of this so that it can initialize the COM subsystem for that thread (via CoInitializeEx()).

Win32::OLE cannot simply be cloned and used in a different thread: COM objects belong to an "apartment", and depending on the COM threading model used by Perl and the external components, it is possible that COM pointers need to be marshalled to be accessible from a different thread.

It is on my todo list to implement this, but I'm currently very busy with other stuff.

BTW, there are other modules too that need per-thread initialization etc. that need fixing before they can be used with Perl 5.8 and threads, e.g. Win32::ODBC.


In reply to Re: threading and Win32::OLE by jand
in thread threading and Win32::OLE by ebodine

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.