Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Run 2 processes simultaneously?
Message
De
20/08/1999 23:48:08
 
 
À
20/08/1999 23:28:06
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00255462
Message ID:
00256202
Vues:
29
>>If I run 2 copies of VFP, can I share public variables between them?
>>
>
>No, but you could share a .DBF file.

Let me expand on this a bit. A .DBF file is sharable between multiple processes on a machine, or even on different machines. There are other ways to approach this as well, especially if you need to trigger something in a separate instance of VFP after something happens in another (ie your data collection app gets an input stream from the comm port; whenever if receives an end-of-line, the other process has to do something.

Microsoft's MSMQ messaging system is a good tool for this; it was demonstrated by some of Microsoft's people at DevCon this year. If you have discrete events that needs to be signalled on an unpredictable basis, MSMQ provides an inter-process messaging capability that can be accessed by a VFP app using an ActiveX control rather than a whole lot of API programming and without polling to see if something has happened on a frequent basis. If you're using NT and have some in-house resources to handle configuring an MSMQ server, MSMQ offers some attractive and potent capabilities.

It's a whole lot more work than sharing a table, writing new data records as they came in from the serial port, and periodically checking to see if a record has been added. If infrequent polling is acceptable, you could open up a shared table, whenever the data had been collected by the serial pickup part of the app, append a record and put the data in there. On the other side of the fence, you would open the same table (obviously shared) and you could then set up a timer that triggered periodically, checked if any new record(S) had been added, and did what needed to be done at that point. One obvious advantage here is that you don't need an MSMQ server or to learn about using MSMQ. It's also easy to split the tasks between two machines; if there's a network and the common file is available to both systems on a shared folder, you can have two machines handle this, with data collection going form one and other processing on anther, using the same bsic code as you would for two tasks on one system.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform