News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

File/Record Locking Question

Started by Draakie, February 22, 2007, 06:44:40 AM

Previous topic - Next topic

Draakie

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
Does this code make me look bloated ? (wink)

u

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.
Please use a smaller graphic in your signature.