I have some long running batch-oriented CGI programs and I want to prevent multiple instances of the program from running at the same time. On unix, I'd hit this nail with the "flock" hammer, but I happen to be working on a windows server. I'm wondering: What's the "best" way to implement this mutual exclusion on windows, and, secondly, is "flock" safe and secure on windows?
Many thanks.