Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesECCO's Unique File-Locking System


November 1995 / Reviews / Organization Made Loud and Clear / ECCO's Unique File-Locking System

When you share files on a network, you need some way to ensure that two people can't modify the same data at the same time. That's easy if you're not expecting two people to try to access one file at once. But with shared files, such as those ECCO uses, you need sophisticated file locking .

ECCO isn't record-oriented, so it can't use the type of locking found in most commercial databases. Instead, it usually (depending on the type of file) locks a file for as long as a client needs it and then unlocks it. This basic protocol is called OF_SHARE_DENY_NONE, which specifies that if the file is already open in another mode, a second open command should fail, but multiple clients can open it in this mode. When the file is open, ECCO sets the first 16 bytes of the file as locked using the DOS FLOCK function (a DOS INT 21H function). Once all this is set up, only the locking process can read or write to the file.

File locking varies a little depending on the type of file you're opening. The most common scenario would run like this. You open a shared file. ECCO opens the shared file itself, loads it into memory on your machine, and then closes it. ECCO then opens a pair of shared status files and holds them open until you close the original file.


Unique File-Locking System

illustration_link (7 Kbytes)

ECCO sets u p locked "channels" to ensure that only one instance of each local file can attach to the shared file.


Up to the Reviews section contentsGo to previous article: Organization Made Loud and ClearGo to next article: Storming the EnterpriseSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network