0
I have an application (Win 32-bit) which makes a changing data set available to other network machines by writing a data file of around 100 kbytes every second. Other PC's read the same file once per second to access and display the data in remote locations. Collisions are expected and occur now and then and are handled by opening the file in the appropriate mode. If any given slave can't open the file because it is being written there are no consequences resulting from it being denied access - it just gets it the next time around.
The system has run with no problems under WinXP for several years but has just been installed on a Windows 8 network and is behaving badly.
After a period of time - usually many hours, and sometimes days - the "master" PC stops updating the file - every access returns The process cannot access the file because it is being used by another process
- so the slaves see "frozen" data from then onwards. The situation is permanent however, and the only course of action is to exit the master application and restart the master PC - just exiting the master application does not release the file.
Does anyone have any suggestions for what could be causing this?
Would SysInternals ProcessExplorer help (using the Find handle" function)?
A final note: the data file that is used to make the information available happens to be named with an extension MSI
. Could Windows 8 have introduced some "nanny" functions to prevent applications referencing what it thinks might be MSI installer images? I'm clutching at straws here. Naturally I intend to try something else as an extension, but access to the system is difficult as it forms part of a 24-7-365 system, so I want to gather as much knowledge before then.
1Such frequent access to a static file by many machines isn't very efficient. The system should, ideally, be overhauled to use a database such as MySQL. You can add to the database as many times as you please and your clients simply query it when they want. You won't get any locking problems if the clients are simply reading information. – Kinnectus – 2014-11-22T10:03:16.410
@Chris, Thanks for your comments.
Such frequent access to a static file by many machines isn't very efficient.
I don't understand why you say that? On my PC writing this file takes 15 mS and reading it 4 mS. This overhead is acceptable to us, and I'm not sure MySQL would be any faster. The reason I am having locking problems is because it's not working as I believe it should. – rossmcm – 2014-11-22T22:10:42.223But the pure nature of reading and writing a file will inevitably give a collision that you're experiencing. A database is designed to provide many thousands of simultaneous connections. Why do you think, say, Facebook isn't a massive file being read and written to. It's not that your process is necessarily wrong, it's just using the wrong tool for the wrong job and you're experiencing the pitfall of the wrong tool. Moving on, though. Is the "master" (server) the Win 8 machine? – Kinnectus – 2014-11-22T22:53:05.743
What's the network connection speed of the Win 8 machine? Is it a gigabit connection and the clients are slower? I've seen this before with Access databases but may produce similar problems with static files. Also, what is the power setting of the master PC network adapter? Does the master have any power settings configured? – Kinnectus – 2014-11-22T22:56:09.227
@Chris - sorry for the delay in replying. All machines are on their own 100 Mb subnet, all running Win8. The NWC's all have any power settings disabled. – rossmcm – 2014-12-06T00:36:51.120