Hi Fernando,
Rick provided a good detailed answer to your question. When you think about all of the public variables and environment settings in VFP, it's not a good candidate for free-threading. VFP MTDLLs are "thread-safe" in the sense that each thread/apartment hosts a completely separate instance of the VFP environment. You don't have to worry about one apartment corrupting another.
As far as critical sections, you don't need them for VFP environment settings, but you may still need them occasionally for resources shared by multiple threads. For example, if you have code that creates a table after checking if the file already exists. You would want to wrap that code in a critical section, so one thread could finish creating the table before another thread checks for its existence. Conceptually, critical section concurrency isn't all that different than table/record locks, but you're locking code instead of data.
>>Nope. Can't be done. Only apartment model threading is supported.
>>
>
>Hi Craig:
>
>You are surely right, and I've read a lot in last weeks, including this:
>
>
http://fox.wikis.com/wc.dll?Wiki~VFPMTDLLisMultithreaded>
>But something I don't get clear is this: If the apartment model makes sure your code is thread-safe, then what's the support for critical section is for, if the apartment is already protecting you?
>
>Thanks.-