[thelist] CF -- have a Q need a Tip to clean-up my webs.

Raymond Camden jedimaster at macromedia.com
Mon Sep 23 07:05:00 CDT 2002


>
> Way back on Fri Oct 12 19:45:06 2001 Rory.Plaire at
> wahchang.com wrote the
> following in a tip
> (http://lists.evolt.org/archive/Week-of-Mon-20011008/059198.html):
>
> <snip />
>
> > To avoid this bit of tedium and performance hit, try
> putting the UDFs in a
> > "library file" and cfincluding that in the Application.cfm
> file. Since the
> > server stays in a multi-threaded condition, the performance
> is increased
> > and, more importantly, cflocks no longer grow like the
> pestilent weed in
> > your carefully cultivated code.
>
> Point of clarification: inside the "library file", the UDFs should be
> wrapped in a cflock right? This way the cflock is inside a
> thread and not
> around the application? I don't recall reading anywhere
> (other than above)
> that having a cflock in application.cfm will block all
> thread? Is there a
> reference or publication somewhere that has more information?

There is no need for cflocks just because you are defining the UDFs in
application.cfm. Just like there is no need for cflock if you do <cfset
x = 1> in application.cfm. You only need locks (prior to CFMX) if you
are using application variables, for example, <cfset application.x = 1>,
or ...

//assume foo is a udf
application.foo = foo;

Macromedia recommends _against_ copying UDFs to the application scope.
If you need easy access to them in custom tags, consider copying them to
the request scope.

=======================================================================
Raymond Camden, ColdFusion Jedi Master for Hire

Email    : jedimaster at macromedia.com
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda





More information about the thelist mailing list