Hiya
I've been considering a multi-user implimentation of an application that needs to access
files accross a network. The File and Record locking mechanics bother me a bit though.
The general api's do allow for standard File Locks/shares etc. BUT Record based locking
looks to be up to the programmer. Has anyone done this sorta stuff ? Do I just create
an extra field in the Record and test if it's beieng read/written to /deleting etc. Comments
appreciated.
Thanx
Use 3 critical sections, each with an array of objects. Each object contains the string-name of locked record, number of read-locks (if in read-mode), and hash of the string.
The 3 arrays are in order: "delete", "write", "read". Each critical-section guards read/write access to the specified array.