Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SyncLock equivalent in VFP
Message
From
26/05/2014 11:07:59
 
 
To
21/05/2014 05:34:59
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 8.1
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01600343
Message ID:
01600691
Views:
48
>still not totally clear at this end what the exact problem is ;-)
>Greg already pointed you to Mutex in dotnet, AFAIR there are pure WinAPI functions for using them, so no need for a dotnet-bridge. Also Semaphore WinAPI functions, if you decide that is the way to go, and your mentioning multiple instances of an exe rules out things like critical section. Doing this with COM STA might be a way if object status has to be single instance.
>But for dumb file processing with [1..n] workers I usually split the task into worker(s) filling a table with [file location, status[ ,taskneeded][,priority]] structure and multiple workers finding those records where status is not in [done, workingstepX] and use normal multiuser record locking strategies to reflect each records/files work status. Allows re-ordering into LIFO, FIFO or task specific order of the task list stack if there is a need with the priority column and multiple stages via updating taskneeded column. And usually processing files is usually so much slower that the overhead for the synch table is negligable, the approach works across process and tasks, and is easily enhanced with bulletproofing via timestamps, machine and process ID's and so on.
>
>View the tasks to be done as data ;-)

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform