Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!usc!hacgate!ashtate!joeb From: joeb@ashtate (Joe Budge) Newsgroups: comp.databases Subject: Re: rlock() in SCO foxbase+. Message-ID: <1266@ashton.UUCP> Date: 24 Sep 90 18:31:23 GMT References: <553@safn2.UUCP> Organization: Ashton-Tate, Torrance, CA Lines: 37 From article <553@safn2.UUCP>, by rey@safn2.UUCP (rey): > > My Dbase IV guide talks about rlock() being cumlative up to 50 locks. > On the same record? Can only 50 different records be locked? ----> A networked PC running dBASE IV under DOS can lock up to 50 different records at once on a shared file server. This is per PC, so if you had 10 PC's on the net they could lock 500 different records - though I pity the guy who then comes along to try to find an unlocked record . If a networked PC needs to lock more records than that, it should try for an flock() on the files in question. A PC can get up to 10 flock()'s, since that's how many work areas you have. The automatic locking mechanism within dBASE IV looks at the scope of the command and determines if it should go for a record lock or a file lock. If you're doing it manually instead (with the rlock() and flock() functions) you have to be judicious in selecting the appropriate one. > > How are the locks implemented? Are they in the .dbf file header or > in the record being locked or in shared memory (Which I > don't think I am using). ----> You are using shared memory, you just don't know it. Networks which support the DOS file locking protocols keep a table of locks on the server itself. The table includes filenames, owner of the lock, and the range of bytes within the file which are locked. All the products I've ever seen which support locking on a DOS network use this protocol. When these products are moved to other operating systems, the vendors still rely on the operating system itself to maintain the locks. Joe Budge