<cfset application.dsn = "foo"/> Does NOT need to be locked.
Correct - multiple execution is unimportant.
<cfif isDefined( 'url.clearCart' )> <cfset session.cart = arrayNew(1)/> </cfif> DOES need to be locked because other threads could be reading from session.cart.
Only if a single user can initiate multiple requests at the same time (frames, RIA).
<cfset session.breadCrumb = arrayAppend( session.breadCrumb, 'Product
Details' )/>
DOES need to be locked because other threads could be reading or writing
to session.breadCrumb.
Same as above.
4) (In a CFC that has been instantiated into the application scope)
<cffunction name="init">
<cfset myInstanceVar = "default" />
</cffunction>
Does NOT need to be locked (either inside the CFC or where the init()
method is called) assuming that the init() method is a constructor and
will only be called once, when that object is instantiated.
Correct - multiple execution is unimportant here.
5) (In a CFC that has been instantiated into the application scope)
<cffunction name="setInstanceVar">
<cfargument name="aValue"
<cfset myInstanceVar = arguments.aValue />
</cffunction>
DOES need to be locked (either inside the CFC or where the
setInstanceVar() method is called) if other threads could be reading
from myInstanceVar.
Probably not - an arbitrary thread reading the value will either get the old value or the new value (which may or may not matter) but it won't fail. Mind you, if you have multiple requests setting values into application scope (implicitly through the instance variable) then you've probably got something weird going on anyway (i.e., your program logic is a bit strange).
Sean A Corfield -- http://www.corfield.org/blog/
"If you're not annoying somebody, you're not really alive." -- Margaret Atwood
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
