Post by richardbaggett on Feb 10, 2013 21:18:46 GMT -5
As for communication, I use runbasic AND libertyBasic. There is a dll called mesock that can be used with Libertybasic to allow some socket programming. Runbasic is a web application, it doesn't even need mesock. Every computer has a loopback, localhost, or 127.0.0.1...'Nuff said.
As for file locking, I like the 'nix solution of using a 'lock' file. this is just a dummy file with perhaps an extension of '.lock'. When you want to access a file, for instance "data.dat", you first check for the presence of "data.dat.lock", if it does not exist, create it, and use the "data.dat" file. When you are done, simply kill the empty "data.dat.lock" file, and it is released for use by a different thread.
Just be prepared for error when creating the file, it is a certainty that it will eventually be created by a different thread between the time you check for it, and try to create it.