> Ok, given that we all agree:
> 
> ** Access to shared variables should *ALWAYS* be locked **
> 
> Then why on Earth shouldn't I just turn on Automatic Read 
> Locking for Application (and Session et al if I use them) 
> scope and only worry about write locking in my code?
> 
> Why doesn't everyone do that, with the rare exception of some 
> code that has unusual locking needs.
> 
> I've heard the argument that automatic read locking is a 
> slight performance hit. It couldn't be more of a hit than 
> parsing <cflock> </cflock> around every access and still 
> doing the read lock anyway!

That's certainly an alternative. However, I'd argue that you want to write
the code so that, all other things being equal, that code is safe. You
might, for example, not have control over server configuration, or you might
be writing a shrinkwrap application.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to