[thelist] cflock reads?

Pete Freitag pf at cfdev.com
Mon Jan 21 16:13:45 CST 2002


Rudy,

	When you read from a variable without locking that is being written to it
does not do any checking at all, and just goes into RAM and grabs it.  Its
very tedious to lock all reads, so you might want to look into the
"AutoMatic Read Locking" feature in the ColdFusion Administrator (as of
CF4.5 and up), so that you only have to lock writes.

Another option if you are running a low traffic site is to run coldfusion in
single threaded mode, this eliminates the need for locking, but
significantly reduces the number of pages it can serve up in a second.

_____________________________________________
Pete Freitag (pfreitag at cfdev.com)
CFDEV.COM
Web Developer Resources
http://www.cfdev.com/


-----Original Message-----
From: thelist-admin at lists.evolt.org
[mailto:thelist-admin at lists.evolt.org]On Behalf Of rudy
Sent: Monday, January 21, 2002 4:29 PM
To: thelist at lists.evolt.org
Subject: Re: [thelist] cflock reads?


> You need to lock the read in case of another page updating it,
> particularly in the case of frames.  You are correct, logically it
> should never happen, but a "better safe than sorry" approach
> in CF code design.

thanks chris, but again, i have a hard time understanding this when we're
talking about *session* variables -- application variables maybe

i can understand almost-simultaneous session hits from a double click, but
not where frames are concerned (but let's snot go there, because i will
never code a framed site)

and shouldn't the collision be controlled by an exclusive lock on the
update?  so that if a simultaneous update *does* try to take place, it has
to *wait* until the read is finished?

i'm afraid i still don't understand why the session *read* has to be locked


oh, and another thing --

if the session value actually changes between the time the read is
initiated and the read is completed (which i still cannot understand how
this would happend *for the same user*), my question is SO WHAT?

i mean, what difference does it make?  ***it's the SAME user***

boy, am i thick-headed today


rudy


--
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt !





More information about the thelist mailing list