Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can be a VFP9 MTDLL ThreadingModel changed to Free?
Message
De
17/06/2015 15:14:07
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
11/06/2015 10:02:22
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows NT
Database:
Visual FoxPro
Application:
Web Service
Divers
Thread ID:
01620899
Message ID:
01621092
Vues:
131
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.-
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform