On Tue, 30 Nov 2004, Stas Bekman wrote:
> What about the solution of ithreads? Originally ithreads were storing
> their context in ThreadLocalStorage, and this didn't work under mp2,
> so it was rewritten to store the context in a perl PL_ interpreter
> global, now ithreads can be run inside the same thread.

I'm not sure what you are referring to.  As far as I know the Perl context
for a thread is still stored in TLS.  Can you point me to the relevant
changes and/or the PL_ name you are talking about?

> Could the same solution be applied for COM context? Make it
> independent from threads?

You will have to ask Microsoft about this. Something tells me their
answer will be: "Don't use COM, use .NET".

For Win32::OLE this could be solved by only using the free-threaded
apartment model, which is already done by default. But you will still
need to initialize each new thread to join that apartment.  I guess each
Perl interpreter could keep a global cache of thread ids and just try
to call CoInitialize() when it hasn't been run in this thread before.
Of course this will require all Perl interpreters to use the same
COM threading model, but that is not really a big restriction.

Cheers,
-Jan




-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to