Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SyncLock equivalent in VFP
Message
 
À
20/05/2014 15:44:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600343
Message ID:
01600735
Vues:
125
This message has been marked as a message which has helped to the initial question of the thread.
>Anyone would know of something similar than then SyncLock of .NET in VFP?

Mutexes will work but can be a pain from FoxPro as they require Win32 structures. You can also use .NET to call and do the locking.

But - you might be able to use simpler solutions using files that can be locked. Dump a file to disk when you access a task and hold it open while the task you want to block is running. Another machine that tries to access that same task then can try to get a lock on the file and if it can't has to wait for it to become available. It's pretty trivial to implement this sort of semaphore locking. Likewise you can a similar locking strategy for FIFO queueing by letting one application getting a lock on a file while the second tries to find an available file to process the next transaction.

The latter is essentially how Web Connection's file mode works and it's proven super reliable over the last 20 years even under heavy load :-)

The nice thing about a fox solution is that you can control it to minute details. If something goes wrong with a mutex your app will lock up pretty much, Additionally using files works across multiple machines, while Mutexes are limited to inter machine operations.

+++ Rick ----
+++ 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?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform