The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Draakie on February 22, 2007, 06:44:40 AM

Title: File/Record Locking Question
Post by: Draakie on February 22, 2007, 06:44:40 AM
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
Title: Re: File/Record Locking Question
Post by: u on February 22, 2007, 08:06:40 AM
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.