This content has been marked as final. Show 2 replies
Just found a reference in the CF8 manual stating locks aren't necessary when setting application scope variables in OnApplicationStart
In the LiveDoc: ColdFusion Developer's Guide / Designing and Optimizing a ColdFusion Application / Defining the application and its event handlers in Application.cfc
It's a frame setup, but the specific page (on my local machine) is htmldocs/help.html?content=appFramework_10.html
> Just found a reference in the CF8 manual stating locks aren't necessary when
> setting application scope variables in OnApplicationStart
Yes, one generally does not need to lock access to shared scope
variables, such as application, unless there is a risk of race
conditions that could cause a problem. In other words, if there is no
risk of a race condition, or even if there is a race condition it does
not cause a problem, i.e. 90% of the time, then there is no need to lock.
Over locking code unnecessary can have performance and throughput
consequences to an applications scalability.
This advice is generally left over from ColdFusion 4.5 days, when there
was a bug in CF that could cause memory leak problems if shared scope
variables where not religiously locked. This problem has been resolved
for years, but the advice persists.