Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What happens when multithreaded COM object uses another
Message
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00308561
Message ID:
00308572
Views:
13
>Lets assume that I've created a multithreaded VFP COM DLL that will be invoked by an ASP application. Lets further assume the my COM DLL in turn uses a third-party DLL such as FOCUS.DLL or FOXTOOLS.DLL. How do I know if these other DLL's are thread-safe? How does the system deal with a single-threaded DLL being loaded and used by a multi-threaded DLL? Do I even need to worry about it? Thanks very much!

A single threaded DLL will launch of the existing thread that it was called from. Since that thread is under COM's control and guarantees access to your server for the duration of the method call there will be no problem with a single threaded DLL call for the call itself.

What there can be problems with however is if those DLLs have Public memory or object variables. Those are visible to all instances running in IIS or MTS and thus have the potential to get corrupted by simultaneous memory access. I would guess that FoxTools is probably safe since it has lots of small self contained functions that are most likely built in pure local stack storage. Others like Focus you have to check (I'm guessing the same is true there since it's a 'library' of small features).
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Reply
Map
View

Click here to load this message in the networking platform