in reply to Win32::OLE and threads
Yes. I see exactly the behaviour you describe. Everything seems to run fine, but it never exits. This isn't a surprise. For example, if the OLE code uses the process ID to key stuff off internally, calling it multiple times from the same process on different threads is going to confuse it. And a brief look with a debugger at what is going on, seems to indicate that OLE is getting very confused.
There are no less that 9 threads running in the process, after your 3 have terminated. Of those, 4 are sitting in RegisterWaitForInputIdle wait states, and will never be awoken.
I won't pretend to have looked into this very far, but it seems safe to say that using Win32::OLE in conjunction with threads is a no no. At least, if you call OLE from multiple threads.
It's possible, but I haven't tried it, that like several other packages--Tk, DBI etc.--you might get away with using it in conjunction with threads, provided that you only call it from one thread. It may be that it would only work if you only call it from the initial thread.
|
|---|