Hi Claude,
>Sorry, for most intents and purposes vfp multi-threaded dlls(mtdlls) are indeed multithreaded(thus the name). Multiple threads are running at the same time. The technology behind it doesn't really matter as far as this is concerned...
Just for the lurkers out here...
All VFP DLLs are multi-threaded. All VFP DLLs run in single-thread apartments. The difference between a DLL and an MTDLL is that the VFPnT runtime is thread-safe, whereas the VFPnR runtime is no. You can create as many threads with DLLs as you can with MTDLLs. However, because the runtime is not thread-safe, VFP will create copies of the VFPnR runtime files that have a different name. That is, the main difference between DLL and MTDLL thread-wise is that DLLs consume more resources when you run them in more than one thread.
"multi-threading" and "single thread apartment" are as related to each other as cucumbers and zucchinis. They look alike, but are completely different.
The counterpart of "multi-threaded" is "single-threaded". It defines in how many different threads a DLL is
executed.
The counterpart of "apartment threaded" is "free threaded". It defines how many other threads can
call a DLL running in a single thread at a time.
All VFP DLLs are apartment threaded. That means, I can have as many threads as the operating system and the resources permit. Each thread can host as many objects from as many DLLs as you need. However, in each thread only one method of one object can be called at any time. Any attempt to call another method results in a blocking condition of the caller.
--
Christof
--
Christof