> Does this require a lock?
>
> I was reading through the CF WACK, and it has an example like so:
> <cflock name="#application.applicationname#_whatever" type="exclusive"
> timeout="10">
>
> does reading the app scope require a lock?  Would I nest two locks?  Or is
> it not required because the application name does not change?

Barney's response - specifically his first paragraph - provides a very
good answer, but there are some additional details which might be
helpful.

Prior to CFMX, concurrent access to variables could cause server
stability problems, so most developers at the time locked all access
to anything in the Server, Application or Session scopes. That legacy
remains in a lot of code samples even today - once you learn a habit,
it's hard to unlearn. But as Barney said, you don't need to lock
access to code unless that code can cause a race condition.

If you are going to use locks - presumably because you might have a
race condition - you'd need to lock both the reads and the writes that
might happen concurrently. So, yes, reading the app scope would
likewise require a lock set to TYPE="READONLY".

You should NEVER nest locks. Locks, by their very nature, cause
bottlenecks, and nested locks can cause unpredictably bad bottlenecks.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, online, or onsit

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:334139
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to