TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: all
from: Erik Huelsmann
date: 1996-03-18 13:15:46
subject: file locking

Hello !

Never before have I been programming using record locking. 
Everywhere I try to find info on it, the docs state that unlocking should
be done on the same region as locking, but nowhere is stated that I can
lock multiple regions.

So: Can I lock multiple regions in one file? And if so, is there a way of
telling how many regions I can lock within a file?

And one more question: _When_ do I use file locking? I suppose it is not
necessary to lock a piece of a file each time I access it, but what is
secure? ie what is the minimum safe situation when you have to lock a file?

The situation I am primarily interested in at the moment:
 I have 2 apps running querying the same database. I know I have to lock a
record when changing its contents, but they run extensive indexing
routines. When I am querying through the index, I do it in a recursively
called routine. So on return of the routine, the index might have changed,
but in the majority of cases it will not. Should I lock the index-block
with shared read access, lock completely, or will this recursively calling
and locking parts of the file exceed the lockbuffers?


Bye, Erik!
[TeamOS/2 NL]
reactions preferrably by echomail
_personal_ reactions preferrably by e-mail
[internet: ErikH{at}hcc-gron.idn.nl]

--- FleetStreet 1.14 NR
* Origin: ORIGINal messages, I like them (2:500/19.1929)
SEEN-BY: 50/99 78/0 270/101 620/243 711/401 409 410 413 430 808 809 934 955
SEEN-BY: 712/407 515 517 628 713/888 800/1 7877/2809
@PATH: 500/19 9 28/777 2/777 396/1 270/101 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.